I want to show static data using mysql if id has no value in another table. I’ve used Left Join in joining them and if the id from another table does not exist in the table joined it will not display a thing, so is it possible to display a value for that specific id with no equal values in the other table?..
Share
You can use COALESCE(yourLeftJoinTable.yourLeftJoinField,0) to display 0 if the value is null i.e.
The following assumes table1 has field (id INT PK), and table2 has fields (id INT PK, t1_id INT) where table2.t1_id links to table1.id