Mysql query to join three tables

后端 未结 2 1605
抹茶落季
抹茶落季 2020-12-14 20:01

I am using this query:

SELECT a.sales_id, d.bus_title, a.cat_id
FROM tbl_sales a
INNER JOIN tb_category b ON a.cat_id = b.cat_id
INNER JOIN tbl_business d ON         


        
2条回答
  •  感动是毒
    2020-12-14 20:30

    I am not a great fan of inner joins so try this:

    SELECT a.sales_id, a.cat_id, c.bus_title
    FROM tb_sales_category a, tb_sales b, tbl_business c
    WHERE a.sales_id = b.sales_id
    AND b.bus_id = c.bus_id
    

提交回复
热议问题