mysql left join : the value NULL is returned if there is no matching row, but I want a null value -


lets'suppose 2 (simplified) tables, user , house :

     id | firstname      1  | charles      2  | frank      3  | mark  user_id | city     1   | london     3   | paris  select firstname, house.city user  left join house on user.id = house.user_id; 

the column city declared "default null"; result :

firstname | city   charles | london   frank   | null   mark    | paris 

this result stored in other table

in table, later, want test "city null" have test "city = 'null' "

so how can force left join set real null value when there's no match ?


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -