mysql怎么联合查询,有用户表A,和订单表B,用户表有UID和状态SID字段,其中订单表中有用户表的UID字段

请问怎么查询出状态SID为1的订单表B中的订单数据,
2025年03月23日 02:12
有3个网友回答
网友(1):

select *
from B
left join A on A.uid = B.uid
where B.sid = "1"
其中*号最好不要用,自己把表里的字段一一列举

网友(2):

select b.* from a,b
where a.uid=b.uid and a.sid=1

网友(3):

where xx.uid='xx'and xx.sid='xx';