Hi
I'm stuck with a query that's supposed to return all rows in the 'pages' table that aren't referenced in the 'menus_pages' table
I have three tables being queried :
'pages' (t1), where the useful col is 'p_id'
'page_content' (t2), where the useful col is 'p_id'
'menus_pages' (t3), where the useful col is 'page_id'
I need to select all rows in 'pages' (and join on the data in 'page_content') that don't have their p_id in 'menus_pages'
so far I've got this sql :
SELECT t1.p_id, t2.p_h2_title, t2.p_lang FROM pages AS t1
LEFT JOIN page_content AS t2 ON t2.p_id=t1.p_id
LEFT JOIN menus_pages AS t3 ON t3.page_id=t1.p_id
WHERE t3.page_id NOT IN (SELECT t1.p_id FROM t1)
AND t2.p_lang='fr'
ORDER BY t2.p_h2_title ASC
but it's not returning any rows when it should return 1 row
I'm sure I'm not doing this correctly...
thanks for any help you can give me