mysql输出有关问题,请问上大家

WBOY
Release: 2016-06-13 12:58:16
Original
748 people have browsed it

mysql输出问题,请教下大家


sn          name         sub        time 

1             王1       数学         2012-1-1

2             王2         语文        2012-1-1  

5             王3       体育        2012-1-2

4             王4         科学        2012-1-2  

输出

2012-1-1

语文        

数学

2012-1-2

体育

科学

说明:就是按照时间输出时间对应的内容要放在一起。

------解决方案--------------------
select time, group_concat(sub) from tableName group by time

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!