select min(code) as AC
from Tab1e1
where id=1
Union
select min(code) as AC
from Table2
where id=1
我得到的行如下
ac
--
101
null
但我不想要空行。我该怎么办?可以帮助我吗?
答案 0 :(得分:0)
尝试为每个
添加此条件and code is not null
像
select min(code) as AC from Tab1e1 where id=1 and code is not null
Union
select min(code) as AC from Table2 where id=1 and code is not null
因为代码值为空