I\'m modifying some code for a community news website, so that the main news wire shows every story posted - except for one category of stories. Not every story is categorised. So I have to SELECT all categorised stories which aren\'t from $bad_category_id, and I have also SELECT all un-categorised stories.
I\'ve found a way to do it but it\'s very slow. The news is in a table called webcast, the categories are linked to by a link table called catlink. catlink.id is the link to webcast.id, and catlink.catid is a link to another table category.id. I only found out about JOINS last night ... so maybe there\'s a better way.
This is the (simplified) SQL:
It\'s too slow. The opposite query (select only the bad category) is easy and fast:
I tried this:
But that caused a disk space error! Oops. I think it\'s wrong anyway...
Yo thanks!