我有 2 个查询在同一张表上以相同的条件执行 SELECT。你能帮我删除这个重复吗?
if exists(select count(1)
from (<table>) t
where (<condition>)
having count(1) = 1)
set @yes = 1
if @yes = 1
select @x = X
from (<table>) t
where (<condition>)