补充:例如 A=a, B=b, E=e 或 A=a, C=c , D=d
解决方案 »
- |zyciis| 求对比两条SQL效率,条件写在On和写在最后 Left Join的情况
- !!!求一句SQL语句
- 一个有意思得不得了的游标问题 :)
- 求多列操作的COUNT语句
- 网站遭流量攻击 导致sqlserver cup 100% 怎么解决,在线等,谢谢
- 为什么我把机器名字改了以后,我的SQL2000服务器就不能启动了,
- 关于三张表full outer join 的问题,向高手求助!
- 关于大数据量的问题,经验丰富者里面谈!
- 在存储过程中可递归调用自定义函数吗?如何实现?
- SQL Server中数据发生了变化47.8变成了47.79999,谁知道?
- DBA来看看 数据优化的过程中发生的 (Read80trace命令)
- 有关sql server2005 express
declare @keyID varcahr(10)
declare @icount int
set @icount = 0
if exists( select 1 from where A = 'a' and KeyId = @keyID)
set @icount = @icount + 1
if exists( select 1 from where B = 'b' and KeyId = @keyID)
set @icount = @icount + 1
if exists( select 1 from where C = 'c' and KeyId = @keyID)
set @icount = @icount + 1
if exists( select 1 from where D = 'd' and KeyId = @keyID)
set @icount = @icount + 1
if exists( select 1 from where E = 'e' and KeyId = @keyID)
set @icount = @icount + 1
if @icount = 3
select * from tb1 where KeyID = @keyID