If I have a SELECT statement like: SELECT cola, colb, sum(tableb.colc * tableb.cold) AS Total FROM TableA GROUP BY cola ORDER BY Total
...I get an error, I think because of referring to Total in the ORDER BY clause. Is it not possible to refer to column aliases anywhere within a SELECT statement other than in the AS clause? If not, is there any other way to achieve this without repeating the sum expression? Pete Molly's Revenge <http://www.mollysrevenge.com> _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users