我写的这个sql查不出来结果,目的是要能出来这种sql结果就对了,fgroups里保存的是用逗号分隔的组ID
select a.* from fz_product a where a.uid=12 and 1 in (1,5)
这是我写的sql
select a.* from fz_product a where a.uid=12 and 1 in (select b.fgroups from fz_product b where a.proid=b.proid)
...全文
1306打赏收藏
求一sql语句
我写的这个sql查不出来结果,目的是要能出来这种sql结果就对了,fgroups里保存的是用逗号分隔的组ID select a.* from fz_product a where a.uid=12 and 1 in (1,5) 这是我写的sql select a.* from fz_product a where a.uid=12 and 1 in (select b.fgroups from fz_product b where a.proid=b.proid)
select a.* from fz_product a where a.uid=12 and concat(',',(select b.fgroups from fz_product b where a.proid=b.proid),',') like concat('%,',rtrim(1),',%')