我经常需要在SQL中注释掉一行或一行。在大多数情况下,我的查询将被加载到另一个工具,如BIRT,它将查询转换为单行。因此,我不能只使用单行注释( - ),必须使用多行注释(/ * * /)。
有没有办法用块注释包围块?例如,我希望能够轻松转变:
select *
from foo, count(*)
where foo.bar = '1'
and foo.baru != foo.bar
and foo.barid in
(select barid from bar where foo = 1)
group by foo
order by foo desc;
进入这个:
select *
from foo, count(*)
where foo.bar = '1'
and foo.baru != foo.bar
and foo.barid in
(select barid from bar /*where foo = 1*/)
group by foo
order by foo desc;
谢谢!