22,209
社区成员
发帖
与我相关
我的任务
分享
select * from xsb a
where 销售日期>='2008-7-20' and 销售日期 <='2008-8-16'
and exists ( select 1 from kcb where 商品编号=a.商品编号 and 供货商 ='GZJCYYYXGS' ) --供货商改为=,条件用exists
--或
select
a.*
from
xsb a
join
kcb b on a.商品编号=b.商品编号
where
a.销售日期>='2008-7-20' and a.销售日期 <='2008-8-16' and b.供货商 ='GZJCYYYXGS'