我需要获取订单详细信息(user name
,shipment method
,line_items(products)
)。我编写此查询,但未得到结果。
select * from orders o
inner join user u on o.user_id=u.id
inner join shipment_method sm on o.shipment_method_id=sm.id
right join line_items l on l.order_id = o.id
where u.id=11;
我尝试了一些查询,但是我被卡住了,不知道在哪里。
订单表
id
shipment_method_id
user_id
line_items表
id
order_id
product_id