MySQL - JOIN a OR b

后端 未结 3 1457
猫巷女王i
猫巷女王i 2021-01-17 02:43

Let\'s say I have a TABLE a in which a COLUMN data is the one to join on for 2 other tables (TABLE b and TABLE

3条回答
  •  感动是毒
    2021-01-17 03:46

    Try something like this:

    SELECT IFNULL(b.info,c.info) AS info
    FROM a
        LEFT JOIN b ON a.data = b.data
        LEFT JOIN c ON a.data = c.data
    

提交回复
热议问题