首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

从结果集中筛选解决办法

2012-01-07 
从结果集中筛选selectsum(total)fromselectcount(*)astotalfromtvistedgroupbyuserid用这句话查询时总是说

从结果集中筛选
select   sum(total)   from   select   count(*)   as   total   from   tvisted   group   by   userid

用这句话查询时总是说“在关键字   'select '   附近有语法错误。”不知道为什么




[解决办法]
select sum(total) from
(select count(*) as total from tvisted group by userid)a

热点排行