4个字段
auit 字段 bool的判断 值1,0
Suppliers 字段 厂家
Suppliers1 字段 厂家1
Suppliers2 字段 厂家2
selet 出 auit=0 并且厂家(Suppliers,Suppliers1,Suppliers2)都有相同值的sql 谢谢啊
auit 字段 bool的判断 值1,0
Suppliers 字段 厂家
Suppliers1 字段 厂家1
Suppliers2 字段 厂家2
selet 出 auit=0 并且厂家(Suppliers,Suppliers1,Suppliers2)都有相同值的sql 谢谢啊
from ta
where auit = 0 and suppliers = suppliers1 and suppliers = suppliers2
select * from tb where auit=0 and Suppliers=Suppliers1 and Suppliers1=Suppliers2
select
*
from
tb
where
auit = 0 and suppliers = suppliers1 and suppliers = suppliers2
SELECT * FROM @a
WHERE audit=0 AND
CASE WHEN CHARINDEX(S,S1)>0 AND CHARINDEX(S,S2)>0 THEN 1 ELSE 0 END+
CASE WHEN CHARINDEX(S1,S)>0 AND CHARINDEX(S1,S2)>0 THEN 1 ELSE 0 END+
CASE WHEN CHARINDEX(S2,S1)>0 AND CHARINDEX(S2,S)>0 THEN 1 ELSE 0 END
>0
只要出现就查询的到 貌似楼上的想复杂了
select * from tb
where
auit=0 and
(suppliers is not null or suppliers1 is not null or suppliers2 is not null )
只要出现就查询的到---还是这个意思啊?