还是数据库问题

jdbcodbc 2009-03-26 02:38:31
select top 10 UserAccounts.userid,isnull(Nickname,'') as Nickname ,isnull(sum(GiftCount*50),0) as score, GiftID from UserAccounts
join GiveGiftLog
on UserID2 = UserAccounts.userid
and giftid = 101
and usertype=20
and score>2400000
and RecordTime between DATEADD(ww, DATEDIFF(ww,0,getdate()),0) and DateAdd(ww, 1, DATEADD(ww, DATEDIFF(ww,0,getdate()),0))
group by UserAccounts.userid,Nickname,giftid order by score desc


这里SCORE>2400000是错误的,查询出来的结果是显示列名无效的,应该怎么改啊?
...全文
46 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
jdbcodbc 2009-03-26
  • 打赏
  • 举报
回复
可以了,太谢谢了
htl258_Tony 2009-03-26
  • 打赏
  • 举报
回复
select top 10 UserAccounts.userid,isnull(Nickname,'') as Nickname ,isnull(sum(GiftCount*50),0) as score, GiftID from UserAccounts 
join GiveGiftLog
on UserID2 = UserAccounts.userid
and giftid = 101
and usertype=20
and RecordTime between DATEADD(ww, DATEDIFF(ww,0,getdate()),0) and DateAdd(ww, 1, DATEADD(ww, DATEDIFF(ww,0,getdate()),0))
group by UserAccounts.userid,Nickname,giftid
having isnull(sum(GiftCount*50),0)>2400000
order by score desc
dawugui 2009-03-26
  • 打赏
  • 举报
回复
select top 10 UserAccounts.userid,isnull(Nickname,'') as Nickname ,isnull(sum(GiftCount*50),0) as score, GiftID from UserAccounts 
join GiveGiftLog
on UserID2 = UserAccounts.userid
and giftid = 101
and usertype=20
and RecordTime between DATEADD(ww, DATEDIFF(ww,0,getdate()),0) and DateAdd(ww, 1, DATEADD(ww, DATEDIFF(ww,0,getdate()),0))
group by UserAccounts.userid,Nickname,giftid
having sum(GiftCount*50) > 2400000
order by score desc

22,210

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧