I'm trying join 2 tables and think I require a LEFT join as all rows in table1 are required but struggling to handle the rules associated with table2. Looking for some help/guidance. My tables are basically:
1. Mr Smith
2. Mr Davis
3. Mrs Jackson
imageid. Main_image. userid
23. Y 1
24. N. 1
25. Y. 2
I'm looking for a query that will return every row in table1 then rows associated in table2 assuming the main_image flag is set to Y.
I've done a left join but when append AND main_image = Y i lose rows from table1 that don't match that criteria I.e. User 3. How can I pull all users from table1 then pull in all main_images from table2?
Hope u get the gist having trouble easily documenting this as typing it on an iPhone but any help greatly appreciated.