草庐IT

commentsCount

全部标签

mysql - "group by"可以不丢失原始行吗?

我有这样的查询:ID|name|commentsCount1|mysqlfordummies|332|mysqlbeginnersguide|22SELECT...,commentsCount//willreturn33forfirstrow,22forsecondoneFROMmycontentsWHEREnameLIKE"%mysql%"我还想知道所有行的评论总数:SELECT...,SUM(commentsCount)AScommentsCountAggregate//shouldreturn55FROMmycontentsWHEREnameLIKE"%mysql%"但是这个显然