MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Mike Machado Date:March 28 1999 8:38pm
Subject:Sql Query
View as plain text  
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
Network Specialist

Sql QueryMike Machado28 Mar
  • Re: Sql Queryjkraai29 Mar