I'm not quite sure how to ask about this, so I will give an example
I have a huge table that resembles something like this ...
Name Widgets TransDate Location Abby 2 12/1/2010 Middleton Abby 13 1/10/2011 Burmingham Bobby 10 12/12/2011 Easton Bobby 5 10/10/2011 Weston . .
And my current sql statement ...
SELECT name, widgets, TransDate, Location FROM MyTable WHERE TransDate BETWEEN 1/1/2011 and 12/31/2011
to give me a table like this ...
Name Widgets TransDate Location Abby 13 1/10/2011 Burmingham Bobby 15 12/12/2011 Easton Bobby 5 10/10/2011 Weston . .
How to change the above SQL to also get rid of people records that do not match the widget quota X ... let's say X = 16. In this case, Abby will be dropped because her total number of widgets is 13 and Bobbyβs entries will remain because he the total amount is 20.
Thank you in advance!
source share