22,209
社区成员
发帖
与我相关
我的任务
分享
--使用关联查询
select [UserName],[PhoneNum],[Address],a.OrderNum,[Express],[ExpressNum],[Operator],[Goods]
from ContactTable a
inner join OrderInfoTable b on a.OderNum=b.OderNum
where a.OderNum=xxx
select c.[UserName],c.[PhoneNum],c.[Address],c.[OrderNum],
ct.[Express],ct.[ExpressNum],ct.[Operator],ct.[Goods]
from [ContactTable] c
left join [OrderInfoTable] ct
on c.[OrderNum] = ct.[OrderNum]
where c.[OrderNum] = xxx