Skip to content
Advertisement

join two tables where unique id is 0 in other table

below are the two tables 1st is media_taxonomy and 2nd is media_taxonomy_map to join

media_taxonomy:

This is table media_taxonomy

media_taxonomy_map:

This is table media_taxonomy_map

here is my sql query

here is the result: enter image description here

BUT, I also want the rows in the joined table where media_taxonomy_id is 0 in media_taxonomy_map table

is this possible?

Advertisement

Answer

I am guessing that you want all rows in the table. If so, just use left join:

If you specifically want matches or 0, then you can filter:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement