Including values NOT FOUND in MySQL query results

后端 未结 3 877
星月不相逢
星月不相逢 2021-01-27 14:17

I have the following MySQL tables:

tbl_pet_owners:

+----+--------+----------+--------+--------------+
| id | name   | pet      | city   | date_adopted |
         


        
3条回答
  •  滥情空心
    2021-01-27 14:34

    Then perform a RIGHT JOIN instead of LEFT JOIN saying

    RIGHT JOIN tbl_pet_types types ON owners.pet = types.pet
    

    In case you want outer joined result for both table (which not sure off), you can then consider doing a FULL JOIN by mixing right and left join

提交回复
热议问题