select 产品信息 from a,b where a.订单号=b.订单号 and 流程状态 ='1'
select a.* , b.* from a , b where a.订单号 = b.订单号 and b.流程状态 = '1'
select 产品信息 from a left join b on a.订单号 = b.订单号 where 流程状态 = 1
select a.* from a left join b on a.订单号 = b.订单号 and b.流程状态 = '1'
select 产品信息 from a表 a where exists( select 1 from b表 where 订单号 = a.订单号 and 流程状态 = '1')
select a.订单号,a. 产品信息 from a a left join b b on a.订单号=b.订单号 where 流程状态=1
刚才回复的写错了!下面两种方法都可以实现,其实上面的朋友都写出来了,我再贴一次select a.* from a left join b on a.订单号=b.订单号 where a.流程状态='1'select a.* from a,b where a.订单号=b.订单号 and a.流程状态='1'
子查询就是:先用一个语句查询出某些数据,再用这个查询出来的数据作为源数据,供外层的查询使用:select * from ta where name in(select name from tb where ...) 红色部份就是子查询
select 产品信息 from a,b where a.订单号=b.订单号 and 流程状态 ='1'
select a.* , b.* from a , b where a.订单号 = b.订单号 and b.流程状态 = '1'
select 产品信息 from a left join b on a.订单号 = b.订单号 where 流程状态 = 1
select 产品信息 from a表 a where exists( select 1 from b表 where 订单号 = a.订单号 and 流程状态 = '1')
子查询就是:先用一个语句查询出某些数据,再用这个查询出来的数据作为源数据,供外层的查询使用:select * from ta where name in(select name from tb where ...)
红色部份就是子查询