Re: [sqlite] bug, or whacky SQL?

2005-05-20 Thread Will Leshner
On May 20, 2005, at 11:46 AM, Rob Laveaux wrote: You can't use a WHERE clause on the result of an aggregation. Use HAVING instead. This should work: select sum(ft) as Pts, pkey from playergame group by pkey having Pts > 15 Doh! Yes, that is it. Thanks a lot.

Re: [sqlite] bug, or whacky SQL?

2005-05-20 Thread Rob Laveaux
On 20-mei-05, at 20:37, Will Leshner wrote: select sum(ft) as Pts, pkey from playergame where Pts > 15 group by pkey I just get back one record with "0" for the value of Pts. I guess what I was trying to do was get back results something like the first query, but for only those sums of ft that

[sqlite] bug, or whacky SQL?

2005-05-20 Thread Will Leshner
I'm not sure if this is a bug in SQLite, or just whacky sql, but lets say I've got a table called playergame with two integer columns, one called ft and the other called pkey and I try to do something like this: select sum(ft) as Pts, pkey from playergame where group by pkey I get back the sum