你可以定义三个变量@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='' 搞定后就可以用这些变量去作为条件了!
MS SQL可以select from (select ...) as temp_table....但是MySQL不支持,只能用临时表,做一个批处理,运行的最后把临时表Drop掉。
然后付值:
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=''
搞定后就可以用这些变量去作为条件了!