1

我对php有点陌生。我的 mySQL 表如下所示:

[Name]      [Subject]
Lukas       Mathematics
Tom         Mathematics
Jane        Mathematics
Ron         English
Jim         Biology
Kim         Biology

我希望它看起来像这样:

[Mathematics]
Lukas
Tom
Jane

[English]
Ron

[Biology]
Jim
Kim

有什么建议我该怎么做?

4

1 回答 1

1

This query is nearest to what you need

SELECT *  FROM myTable GROUP BY subject
于 2013-06-18T22:37:47.203 回答