On 07 Aug 2001 14:57:33 +0200, Anders Alstrin wrote:

> SELECT * FROM media
> WHERE media_id = (SELECT media_id FROM category_locks
> WHERE category_id = (SELECT category_id FROM categories
> WHERE dynamic_media = 'true'))
> 
> A MySQL way to do it?

Something like that should work:

SELECT * FROM media 
LEFT JOIN category_locks USING (media_id)
LEFT JOIN category_id ON (media.category_id=categories.category_id)
WHERE dynamic_media = 'true'

(never tested as I do not have your tables handy)

-- 
For technical support contracts, goto https://order.mysql.com/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Tonu Samuel <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Security Administrator
/_/  /_/\_, /___/\___\_\___/   Hong Kong, China
       <___/   www.mysql.co


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to