there is a method to realize your aim,it is when you have a result just like above,you can create a temp table to store it and then search again.

解决方案 »

  1.   

    你可以定义三个变量@a,@b,@c
    然后付值:
    declare @a,@b,@c
    select @a=a from tabelA where d=''
    select @b=b from tabelA where d=''
    select @c=c from tabelA where d=''
    搞定后就可以用这些变量去作为条件了!
      

  2.   

    MS SQL可以select  from (select ...) as temp_table....但是MySQL不支持,只能用临时表,做一个批处理,运行的最后把临时表Drop掉。