Home  >  Article  >  Backend Development  >  mysql输出有关问题,请问上大家

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

WBOY
WBOYOriginal
2016-06-13 12:58:16749browse

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

Statement:
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