易截截图软件、单文件、免安装、纯绿色、仅160KB

最SQL - MS-SQL Server / 基础类

SQL code:

select
id,s.sid,
(select total_aver_score from car_comment_score where sid = tb2.sid) as '总评分',
supports,series
from
(
select
id,sid,supports,row_number() over (partition by sid order by id desc) as row_id2
from car_comment as comm
) as tb2
inner join car_series as s on tb2.sid = s.sid
where row_id2 = 1 and MinPrice >=0 and MaxPrice <= 550000
order by id desc

现执行如上SQL得到如下的数据,意为不同系列的某一条数据,若现在想得到每个系列下的总个数该怎么弄呢。。。如系列新威驰有88个、昌河海象有35个

??快沉了



引用
select
id,s.sid,
(select total_aver_score from car_comment_score where sid = tb2.sid) as '总评分',
supports,series, count(series) AS seriesNum
from
(
select
id,sid,supports,row_number() ove……


还是没看到我要的结果。。。

SQL code:
select
id,s.sid,
(select total_aver_score from car_comment_score where sid = tb2.sid) as '总评分',
supports,series,count(1)over(partition by series) as 总个数
from
(
select
id,sid,supports,row_number() over (partition by sid order by id desc) as row_id2
from car_comment as comm
) as tb2


相关问答:

sql - MS-SQL Server / 疑难问题

sql的软件在哪里可以下啊!在网上找了蛮多都用不了啊

随便搞一D版吧,

迅雷第一个就可以用
2000,2005都这样

http://119.147.41.16/down?cid=0698C2D64D7D637D90A6D2482298E6717D4F15CD&t=2&fmt=-1 ......

MS SQL作业问题 - MS-SQL Server / 应用实例

如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP

参考:http://hi.baidu.com/toiota ......

求一SQL - MS-SQL Server / 基础类

tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......

SQL语句问题 - MS-SQL Server / 疑难问题

请教高手:
 以下是数据库中的三条记录,英文为字段名称  
  id planname TaskBeginTime Status
329 2010年03 ......

一条 SQL - Oracle / 基础和管理

有这样一条SQL
 Select Get_Costtaxrate(col1), Get_Tcostvalue(col1) from a
 
其中Get_Costtaxrate、Get_Tcostvalue都是函数,这两个函数里面都是查找一个大表,Get_Tcostvalue还需要调用Get_C ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号