Friday, January 3, 2020

SQL Left Join with the same table multiple times.

Using the same table to join with the same table many times, in order to show information coming from the same table. 

Please refer to below left join SQL statement.

        ((`t_goods_bom` `t1`
        LEFT JOIN `t_goods` `t2` ON ((`t1`.`goods_id` = `t2`.`id`)))
        LEFT JOIN `t_goods` `t3` ON ((`t1`.`sub_goods_id` = `t3`.`id`)))

No comments: