Wednesday, February 24, 2010

After 11 AM

Distinct: 4
************************************************
select distinct (sales.repid), fname, lname FROM slspers, sales
WHERE qty > ANY
(SELECT SUM (qty) FROM sales GROUP BY repid)
AND sales.repid = slspers.repid

Without Distinct: 7
************************************************
select (sales.repid), fname, lname, qty FROM slspers, sales
WHERE qty > ANY
(SELECT SUM (qty) FROM sales GROUP BY repid)
AND sales.repid = slspers.repid

>>>>>>>>>> Lisa Ryan<<<<<<<<<

Lisa Prefer to understand
select distinct sales.repid, fname, lname FROM slspers, sales
WHERE sales.repid = slspers.repid AND
qty > ANY
(SELECT SUM (qty) FROM sales GROUP BY repid)

No comments:

Post a Comment