select * from  groups a left join GROUPSTOCKEXTRA b on a.WGROUPID = b.WGROUPID
 where a.WGROUPID = <@KEY@> 
and IIF(b.BPUBLISH = 0 ,0,1) = 1