PDA

View Full Version : difficult mysql question


xiaodao
05-08-2007, 05:36 AM
table structure

C1 ID C2
D1 ID1 10
D2 ID2 6
D3 ID3 14
D4 ID4 5


first i want sort the table according to c1, then i want to add c2 up, then find out the id which when added to sum >=200

can everything combine in one query thanks

guelphdad
05-08-2007, 01:41 PM
so what have you tried so far? note that your sorting should be done last.

xiaodao
05-10-2007, 09:47 AM
i still cannot solve the problem

guelphdad
05-10-2007, 02:04 PM
without posting something you have tried it is unlikely you will get an answer posted for you.