我需要在sql脚本中有一个声明的变量,然后将该变量用作后续脚本的表名称:
set @t := 'table1';
select * from @t as t1
where (select count(*) from @t t2
where t2.name = t1.name) > 1
and exists (select * from @t t3 where t3.name = t1.name and t3.HU > t1.HU)
order by name asc;
我该怎么做。我描述的方式行不通。感谢您的建议。