Re[2]: [sqlite] Re: An SQL question (Not directly related to SQLite)

2007-01-27 Thread ivailo91
On Saturday, January 27, 2007, 6:09:59 PM, Trey Mack wrote: >> Actually, my query is something like >> SELECT ... FROM ... WHERE `pid` = (SELECT `id` FROM ...); >> if i put that group by... will it group all rows, or only those with >> the same pid? > Use a subquery >

Re: [sqlite] Re: An SQL question (Not directly related to SQLite)

2007-01-27 Thread Trey Mack
Actually, my query is something like SELECT ... FROM ... WHERE `pid` = (SELECT `id` FROM ...); if i put that group by... will it group all rows, or only those with the same pid? Use a subquery SELECT price, sum(count) FROM ( -- your original query here SELECT price, count FROM ... WHERE

Re: [sqlite] Re: An SQL question (Not directly related to SQLite)

2007-01-27 Thread ivailo91
On Saturday, January 27, 2007, 4:59:49 PM, Igor Tandetnik wrote: > [EMAIL PROTECTED] wrote: >> I've got a query, let's say query "A" which returns data in the >> following form: >> >> price | count >> 3 5 >> 3 8 >> 4 2 >> 4 9 >> 4 12 >> 6

[sqlite] Re: An SQL question (Not directly related to SQLite)

2007-01-27 Thread Igor Tandetnik
[EMAIL PROTECTED] wrote: I've got a query, let's say query "A" which returns data in the following form: price | count 3 5 3 8 4 2 4 9 4 12 6 10 What I want to do is get unique prices and sum the count of the duplicates, so it gets price | count 3 13