淡然只为遮去锋芒
sql中怎么取名次啊
没有这个字段
按距离大小排序
落叶飞雪
开窗函数?
row_number() over()
淡然只为遮去锋芒
没用过我需要加一个名次 落叶飞雪
噢那就可以 用row_number() over() 直接就实现了
淡然只为遮去锋芒
在这个基础上 梦旅人
承接(C# ,asp.net mvc winform)网站数据抓取、桌面软件、系统软件,web系统(前端采用ext,easyui,dwz,ligerui);,gis桌面系统, 私单,低价承接,如果需要加我细聊,有意者 请与我联系 谢谢!! QQ1714315672
淡然只为遮去锋芒
SELECT [MemberInfo].[MemberID],[City].[CityName],[MemberInfo].[NickName],[MemberInfo].[MemberImg],sum([RideActivity].[RideDistance]) as [RideDistance]
from [MemberInfo] left join [RideActivity] on [RideActivity].[MemberID]=[MemberInfo].[MemberID]
left join [City] on [MemberInfo]. [CityID]=[City].[CityID]
where [RideDistance] <> -65535 and [RideDistance]<&get;0 and [MemberInfo].MemberID=102077
group by [MemberInfo].[MemberID],[MemberInfo].[NickName],[City].[CityName],[MemberInfo].[MemberImg]
order by [RideDistance] desc
落叶飞雪
是不是 还想让我 敲上去咋的?
SELECT [MemberInfo].[MemberID],[City].[CityName],[MemberInfo].[NickName],[MemberInfo].[MemberImg],sum([RideActivity].[RideDistance]) as [RideDistance],Row_Number() OVER (order by RideDistance DESC)as Order
from [MemberInfo] left join [RideActivity] on [RideActivity].[MemberID]=[MemberInfo].[MemberID]
left join [City] on [MemberInfo]. [CityID]=[City].[CityID]
where [RideDistance] <> -65535 and [RideDistance]<&get;0 and [MemberInfo].MemberID=102077
group by [MemberInfo].[MemberID],[MemberInfo].[NickName],[City].[CityName],[MemberInfo].[MemberImg]
order by [RideDistance] desc
你最后一行好像得去掉吧!
淡然只为遮去锋芒
到这里正常 淡然只为遮去锋芒
我蒙蔽了
【
sql中如何查询两个字段值相等的数据】
数据不大的话,考虑用内连接select p1.user,p2.pass from (select user from sp_aaa) as p1 inner join sp_AAA as p2 on p1.