还是问一个mysql的查询汇总的汇总问题
本帖最后由 setoy 于 2013-12-18 18:11:02 编辑 有五个人,uid分别是1~5
有对着这五个人打分的表格(某个人有可能没有得到过分数)
id uid scroe<br />-------------<br />1 1 1.5<br />2 1 1.8<br />3 2 -5.5<br />4 1 0.8<br />5 2 8.2<br />6 1 -2<br />7 4 3<br />8 2 2.3<br />--------------
Copy after login
现在要统计他们所有人的分数,即使查询不到某个人的得分,也要显示0分,显示格式如下:
用户 分数 汇总分<br />-----------------------<br />1 1.5 2.1<br />1 1.8 2.1<br />1 0.8 2.1<br />1 -2 2.1<br />2 -5.5 5<br />2 8.2 5<br />2 2.3 5<br />3 0 0<br />4 3 3<br />5 0 0<br />
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31