I have two tables in my database: en_page and mwpage. Both have a page_title column. What I want is to select the data where both of the page_title values match.
For example
SELECT EN.page_title ENP, MW.page_title MWP
FROM en_page AS EN, mwpage AS MW
WHERE EN.page_title = 'Main_Page'
AND MW.page_title = 'Main_Page'
LIMIT 0 , 30
This query works fine and returns following data:
ENP | MWP
Main_Page| Main_Page
But I have an exceptional case. If any of the table.page_title values don’t match the condition, the query returns no result set. I want it to still return a result set where the table which didn’t match should be empty, like the following:
ENP | MWP
Main_Page|
I don’t know how to do this. Can anyone help?
Try this