一个SQL语句获得某人参与的帖子及在该帖得分总和
摘要:selecta.*,b.SumPointfromExpert_Topic_Indexa,(selectTopicID,Sum(Point)a...
selecta.*,b.SumPointfromExpert_Topic_Indexa,(
selectTopicID,Sum(Point)asSumPointfromexpert_reply_index
wherePostUserName='ghj1976'
GroupbyTopicID
HavingSum(Point)>0
)asb
wherea.TopicID=b.TopicID
这里其实就是把一个查询的结果放到新的一个查询中了。
另外Having对分组结果进行的查询。
【一个SQL语句获得某人参与的帖子及在该帖得分总和】相关文章:
★ SQL Server使用一个语句块批量插入多条记录的三种方法
下一篇:
通用分页存储过程,源码共享,大家共同完善