|
From: Peter G. <pe...@gm...> - 2008-04-07 11:10:26
|
To kick the horse one more time:
On 04/04/2008, at 12:08 AM, Justin Bailey wrote:
> [...] What makes GROUP BY filthy?
It forces me to enumerate fields. I can't say:
SELECT * FROM ... GROUP BY something-star-like
For comparison, here's a relatively-GROUP BY-free rendition of that
previously-send monstrosity:
SELECT ID.*, T.C FROM Items_Descriptions AS ID,
(SELECT IT.tag AS T, count(IT.item_id) AS C
FROM Items_Tags AS IT
GROUP BY IT.tag) AS T
WHERE ID.lang=$1
AND ID.item_id=T.T
param $1 = 'en'
As the Items_Tags table has 2 columns, I'm not too bothered about that
GROUP BY.
Bjorn, congrats on starting a company.
cheers
peter
|