Josh Tolley wrote:
It seems to me you could replace it all with one query, something like
this:
SELECT discipline, COUNT(1) FROM showcase WHERE EXISTS (SELECT * FROM
showcase_item WHERE showcase_id = showcase.id LIMIT 1) GROUP BY
discipline ORDER BY (discipline != 'other'), discipline;
discipline is its own table, not a column, so i'd need to throw a join
in there. I have another table, showcase_discipline to relate from
showcases. I did it this way because there are several other tables that
rely on disciplines (one to one and many to one).
And thanks for the ORDER BY tip! I had no idea i could do that. I'll see
if i can work that in.
brian