求mysql查询集锦语句

WBOY
Release: 2016-06-13 12:31:05
Original
801 people have browsed it

求mysql查询汇总语句~
表结构如下:

id  uid  scroe<br />
-------------<br />
1    1    1.5<br />
2    1    1.8<br />
3    2    -5.5<br />
4    3    0.8<br />
5    2    8.2<br />
6    1    -2<br />
7    4    3<br />
8    2    2.3<br />
--------------<br />
Copy after login

uid即用户id,现在要查询并统计每个用户的总分,显示在用户下面,也即前端显示类似这样:
用户  分数<br />
------------<br />
1      1.5<br />
1      1.8<br />
1      -2<br />
1汇总  1.3<br />
2      -5.5<br />
2      8.2<br />
2      2.3<br />
2汇总  5.0<br />
3      0.8<br />
3汇总  0.8<br />
4      3<br />
4汇总  3
Copy after login

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template