I want to select a value from a third_table where something from the first_table equals another thing from the third_table. This last value from the third table might not exist!
I have the following mysql query:
$query = "SELECT ft.value1, ft.value2, st.value3, st.value4, tt.valueWantedMightNotExist
FROM first_table ft, second_table st, third_table tt
WHERE ft.value5 = st.value5" AND ft.something = tt.anothersomething;
This query returns results only if the value exists. Otherwise it returns nothing. I tried this with FULL JOINas well but ended messing up as well. Can someone explain to me how can I return a null value if the record doesn't exist? Thank you very much...