这个SQL语句怎么不能执行?关于union all
select count(*)
from
(
select id from tb
union all
select id from tb
)
这是怎么回事?
[解决办法]
select count(*)
from
(
select id from tb
union all
select id from tb
)T 这样就可以了 括号后面字母随便你取
[解决办法]
--括号里面的东东是一个子查询,是必须要加别名的。select count(*) from (...) as T
[解决办法]
--楼主少了一个别名
select count(*)
from
(
select id from tb
union all
select id from tb
) a
select count(*)
from
(
select id from tb
union all
select id from tb
)a
--加个别名就可以
select count(*)
from
(
select id from tb
union all
select id from tb
) a