这个SQL语句怎么不能执行?关于union all select count(*)from(select id from tbunion allselect id from tb)这是怎么回事? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select count(*)from(select id from tbunion allselect id from tb)T 这样就可以了 括号后面字母随便你取 --括号里面的东东是一个子查询,是必须要加别名的。select count(*) from (...) as T --楼主少了一个别名select count(*)from(select id from tbunion allselect id from tb) a select count(*)from(select id from tbunion allselect id from tb)a--加个别名就可以 from后面一定要接个表名,你括号内其实是个数据集,你要给这个数据集起个名字才能查询select count(*)from(select id from tbunion allselect id from tb) a 求一条sql,根据年龄段分组,并累加id 这个题用EXISTS怎么写 求SQL语句(sql2005) 如何设计一个高效率批量插入数据的接口,sql语句又如何实现 关于自定义字符串聚合函数 求助:表的规范化操作,看看大家有什么好的方法吗 请介绍个免费的sql查询分析器 在存储过程中这个sql语句拼凑 如何往数据库里插入null 请受过txlicenhe(马可) ( ) zjcxc(邹建) ( ) pengdali(大力 V3.0)等等大侠的帮助的人进来感谢他们的无私奉献 数字转成成日期格式 数字转成成日期格式
from
(
select id from tb
union all
select id from tb
)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
--加个别名就可以
from
(
select id from tb
union all
select id from tb
) a