一个SQL语句获得某人参与的帖子及在该帖得分总和
时间:2024-01-27 07:17:53
select a.*,b.SumPoint from Expert_Topic_Index a,(
select TopicID, Sum(Point) as SumPoint from expert_reply_index
where PostUserName = 'ghj1976'
Group by TopicID
Having Sum(Point) > 0
) as b
where a.TopicID = b.TopicID
这里其实就是把一个查询的结果放到新的一个查询中了。
另外 Having 对分组结果进行的查询。
标签:一个SQL语句获得某人参与的帖子及在该帖得分总和
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
xhtml+css VS div+css
2008-04-07 13:00:00
Python+Pygame实战之24点游戏的实现
2023-11-07 21:14:12
![](https://img.aspxhome.com/file/2023/9/79469_0s.jpg)
python必学知识之文件操作(建议收藏)
2021-10-01 16:28:25
![](https://img.aspxhome.com/file/2023/8/66448_0s.png)
使用numpy.ndarray添加元素
2022-10-31 06:12:15
kali添加开机自启的方法
2023-06-06 04:15:06
![](https://img.aspxhome.com/file/2023/7/132317_0s.png)
Access为后台数据库的网站统计系统
2008-11-16 17:34:00
在ASP中按指定参数格式化显示时间的函数。
2010-05-27 12:29:00
mysql生成指定位数的随机数及批量生成随机数的方法
2024-01-16 18:22:22
![](https://img.aspxhome.com/file/2023/8/119758_0s.png)
加密SQL Anywhere 提升政府行业数据安全
2008-12-03 15:25:00
如何在小空间放置大图片
2009-08-04 13:04:00
![](https://img.aspxhome.com/file/UploadPic/20098/4/01-47s.jpg)
通过yum方式安装mySql数据库的全过程
2024-01-13 11:46:43
![](https://img.aspxhome.com/file/2023/6/115336_0s.png)
python 下划线的多种应用场景总结
2021-12-19 10:51:54
django 将自带的数据库sqlite3改成mysql实例
2024-01-19 14:52:21
![](https://img.aspxhome.com/file/2023/3/98813_0s.jpg)
MySQL优化之如何查找SQL效率低的原因
2024-01-12 21:03:55
sql如何删除数据库中数据记录
2008-10-09 12:31:00
通过vue如何设置header
2024-05-29 22:24:25
![](https://img.aspxhome.com/file/2023/6/123166_0s.png)
go实现一个分布式限流器的方法步骤
2024-04-28 10:46:36
F.conv2d pytorch卷积计算方式
2021-06-26 07:38:41
![](https://img.aspxhome.com/file/2023/4/100854_0s.jpg)
解决Keras 与 Tensorflow 版本之间的兼容性问题
2022-08-04 08:18:53
无组件上传图片到数据库中,asp解决方案
2007-08-03 13:22:00