我有这样的要求:
select t.type_name, m.name, o.width, o.height, o.price
from orders as o
join db_product as p on p.id = o.product
join db_type as t on t.id = p.type
join db_material as m on m.id = p.material
join client as c
join orders_group as og where og.client_id = $id and c.id = og.client_id
$id
从下拉列表中动态选择位置。以下是 id = 29 的查询产生的结果,其中应该正好有六行:
也就是说,每行重复四次。尝试并LEFT JOIN
喜欢这里,但它不会以任何方式影响查询。如何解决这个问题?