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 d.bus_id = a.bus_id
which produces this result:
sales_id | bus_title |cat_id
----------|----------------|------------
1 | Business 1 | 6
2 | Business 12 | 12
3 | Business 123 | 25
I changed the field cat_id into a new table named tb_sales_category
which contains the fields sales_category_id
, sales_id
, cat_id
. How can I write the new query by joining this table too to, get the same result as above?
I am kind of new to databases, need help. Thanks in advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…