where col1=case when A is null then col1 and col2=case when b is null then col2 and col3=case when c is null then col4 and col4=case when d is null then col5
谢谢楼上两位,我的意思不是这样的,select * from table1 where a=a,b=b,c=c,d=100;这样取出来的集合也就是d=100时候的集合,但是 a=a后面的值不是字符串。我想问问有没有等号后面的通配符,想like 后面的‘%’这样的东西
like也是针对字串的,而你又不是字串,不明白你需求
2楼可以啊 a后面不是字符串 是一个判断 相当于 if a is null a=a else a=你的值 end if;
没听明白楼主什么意思,弱弱的问一句,select * from table1 where a=a,b=b,c=c这是什么写法,
and col2=case when b is null then col2
and col3=case when c is null then col4
and col4=case when d is null then col5
a后面不是字符串 是一个判断
相当于
if a is null
a=a
else
a=你的值
end if;