Wednesday, February 24, 2010

Topic D: EXISTS

^^^^^^^^^^^^^Topic D: EXISTS^^^^^^^^^^^^^^^^
SELECT partnum, bktitle FROM titles
WHERE EXISTS
(SELECT * FROM sales
WHERE qty>200 AND sales.partnum = titles.partnum)
?????????????????????My curious?????????????????????
SELECT partnum, bktitle FROM titles
WHERE EXISTS
(SELECT * FROM sales
WHERE qty>200 AND sales.partnum = titles.partnum)

SELECT distinct bktitle, sales.qty FROM titles, sales
WHERE EXISTS
(SELECT * FROM sales
WHERE qty>200 AND sales.partnum = titles.partnum)
and sales.partnum = titles.partnum

No comments:

Post a Comment