[code="java"]
select * from dbo.tbGoodsInfo where (id in (select distinct isnull(goodsId,'') from dbo.tbGoodsBindArea )
or id in(select distinct isnull(goodsId,'') from dbo.tbGoodsBindBar where barUserId='cdcs'))
and auditStatus=0 and bupd!=-1 and goodsType=1
union
select * from dbo.tbGoodsInfo where (id not in (select distinct isnull(goodsId,'') from dbo.tbGoodsBindArea )
and id not in(select distinct isnull(goodsId,'') from dbo.tbGoodsBindBar where barUserId='cdcs'))
and auditStatus=0 and bupd!=-1 and goodsType=1[/code]
如题求解