From: Mike Machado Date: March 28 1999 8:38pm Subject: Sql Query List-Archive: http://lists.mysql.com/mysql/1104 Message-Id: <36FE9330.DAA77169@innercite.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I am trying to run the following query against my database: select username,sum(acctsessiontime) as s from radacct where acctstarttime > 19990326111500 and acctstoptime < 19990326131500 and acctstoptime != 0 and s != 0 group by username order by s desc; It tells me Unknown column 's' in 'where clause' Am I doing the query wrong? I used s as an ORDER BY but it won't let me use it in a WHERE clause? I thought 'as s' lets me use s as if it were a column. It workes just fine if I leave off the 'and s != 0' part (but then I get rows I didn't really want). -- Mike Machado mike@stripped InnerCite Network Specialist