表
|ID |uin |nickname|
|----|----|----|
|1 |1234 |张三|
|2 |1234 |张三|
|3 |1234 |张三|
| 4 |1234 |张三|
| 5 |1234 |张三|
|6 |2345 |李四|
|7 |2345 |李四|
|8 |2345 |李四|
|9 |2345 |李四|
|10 |2345 |李四|
|11 |3456 |王五|
目标结果
|uin_count |nickname |uin|
|----|----|----|
|5 |张三 |1234|
|4 |李四 |2345|
|1 |王五 |3456|
现在只会如下sql<br>SELECT COUNT(uin) as uin_count,nickname<br>FROM Commin<br>GROUP BY nickname<br>ORDER BY COUNT(uin) desc<br>
希望有人帮解答,谢谢
1
liujavamail 2021-02-07 11:14:58 +08:00
这样不就可以了么?
|
2
anonymous2022 OP @liujavamail 结果里没有显示 uin
|
3
NotFoundEgg 2021-02-07 11:16:18 +08:00
SELECT COUNT(uin) as uin_count,nickname,uin
FROM Commin GROUP BY nickname,uin ORDER BY COUNT(uin) desc 这样? |
4
fiypig 2021-02-07 11:18:00 +08:00
加个 uin 不就可以了
|
5
c6h6benzene 2021-02-07 11:18:34 +08:00 via iPhone
作业还是要自己完成…
|
6
anonymous2022 OP @NotFoundEgg 是我愚笨了,谢。
|
7
PAwang 2021-02-07 11:46:00 +08:00
。。。 草 这不就是加个 uin 就行了吗
|