RE: select stmt problem

2001-10-24 Thread Steve Meyers
> Well, count(*) is not a column, it is a function of a column. > When it searches, it doesn't know the result of count so you > cannot specify > it in the where clause. > > This would work, but you have all the records retrieved, not only > the ones > who have more than 10 in the group: > >

Re: select stmt problem

2001-10-24 Thread Kodrik
On Wednesday 24 October 2001 05:43 am, you wrote: > I did the grouping too... "...group by hpnumber" > > so what could be wrong? > > > > > select hpnumber,count(*) as counts from Mobile_Ringtone_Manialogs > > > > where counts > 10 and datesent between '2001-09-24' and '2001-10-24' > > > > and (ret

Re: select stmt problem

2001-10-24 Thread Teddy A Jasin
I did the grouping too... "...group by hpnumber" so what could be wrong? regards, Teddy At 02:13 AM 10/24/2001 -0400, Kodrik wrote: >for one, counts is not a colums, it aggreate values. In your case, since you >didn't group, all record retrieved will have the same value for count(*), the >numb

Re: select stmt problem

2001-10-24 Thread Kodrik
for one, counts is not a colums, it aggreate values. In your case, since you didn't group, all record retrieved will have the same value for count(*), the number of record. So of course you can't order by counts, it's a single value. On Wednesday 24 October 2001 02:43 am, Carl Troein wrote: > T

Re: select stmt problem

2001-10-23 Thread Carl Troein
Teddy A Jasin writes: > Hi, > I have this mysql statement: > select hpnumber,count(*) as counts from Mobile_Ringtone_Manialogs > where counts > 10 and datesent between '2001-09-24' and '2001-10-24' and > (returncode > 0 and returncode < 10) group by hpnumber order by counts DESC > > and i Get

select stmt problem

2001-10-23 Thread Teddy A Jasin
Hi, I have this mysql statement: select hpnumber,count(*) as counts from Mobile_Ringtone_Manialogs where counts > 10 and datesent between '2001-09-24' and '2001-10-24' and (returncode > 0 and returncode < 10) group by hpnumber order by counts DESC and i Get this following error: Unknown column '