I hv a table like this
Model Qty Date
ABC 1 20110102
ABC -1 20110105
QWE 1 20110103
ZXC 1 20110103
ABC 1 20110110
QWE -1 20110110
I wish to hv the final output like this:-
Model Qty Date
ZXC 1 20110103
ABC 1 20110110
How can I do this via SQL ?
Thanks
You want the sum of the Qty and the latest Date for each Model:
QWE has a sum of Qty = 0 and therefore should not be returned, right?