I am moving some code that was developed against MySQL 4.1 to a server with 3.23, and I have one query that uses a subquery. I'm having a bear of a time wrapping my mind around how to convert this. The original query is this:

SELECT page.page_id, page.page_keyword
FROM page
WHERE page.page_id<>6
AND page.page_id
NOT IN (
   SELECT page_links.child_id
   FROM page_links
   WHERE page_links.page_id=6 )

The table `page_links` contains "parent" (page_links.page_id) and "child" (page_links.child_id) mappings for items in `page`. Given a page.page_id=6, I want all items in `page` that satisfy the following:

page.page_id<>6

and

page.page_id<>page_links.child_id only where page_links.page_id=6



So, for a given page, I want all possible child page candidates (condition is that current child pages and the given page are not possible candidates).

Thanks in advance!

kgt




-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to