Mysql EXISTS NOT EXISTS
SELECT c.CustomerId, CompanyName FROM Customers c WHERE EXISTS( SELECT OrderID FROM Orders o WHERE o.CustomerID = cu.CustomerID ) SELECT pub_name FROM publishers WHERE NOT EXISTS (SELECT * FROM titles WHERE pub_id = publishers.pub_id AND type = 'business') ORDER BY pub_name
posted on 2014-03-14 11:07 loveking_阳 阅读(204) 评论(0) 编辑 收藏 举报