Here is my statement
I want the sort the order by values given to me from SUM(SANAL.SA_TRVALUE) I tried putting it in without the SUM but doesn't work. Doesn't work without too. Any ideas?
Code:
SELECT SNAME.SN_TERRTRY, SLOOK.LK_DESC, SUM(SANAL.SA_QTY),SUM(SANAL.SA_COST),SUM(SANAL.SA_TRVALUE) FROM SANAL INNER JOIN SNAME ON SANAL.SA_ACCOUNT = SNAME.SN_ACCOUNT JOIN SLOOK ON SLOOK.LK_CODE = SNAME.SN_TERRTRY GROUP BY SNAME.SN_TERRTRY
ORDER BY ????
I want the sort the order by values given to me from SUM(SANAL.SA_TRVALUE) I tried putting it in without the SUM but doesn't work. Doesn't work without too. Any ideas?