Click to See Complete Forum and Search --> : Group By & Order By


Amyeech
May 26th, 2004, 10:20 PM
Can I use these two conditions (GROUP BY & ORDER BY) in one single command?

SELECT ID_No,SUM(Freq) FROM FaultDatabase GROUP BY ID_No and ORDER BY Freq

Sorry for this weird question. I'm new to SQL.

Thank you in advance.

VictorN
May 27th, 2004, 04:55 AM
try this:
SELECT ID_No,SUM(Freq) FROM FaultDatabase GROUP BY ID_No ORDER BY SUM(Freq)