S
S
shokw0w2017-05-10 05:40:27
Database
shokw0w, 2017-05-10 05:40:27

How to group data so that they follow each other?

There is a database with the following columns:
8e36d1b6476240b59d24eb354073f003.png
I want to display number1, title, theme and idea one after the other, and then group by subjectname. Like this:
number1 1 title titlename theme themename idea ideaname
number1 2 title titlename theme themename idea ideaname
number1 3 title titlename theme themename idea ideaname
Subjectname subject1
Subjectname subject2
Subjectname subject3
Subjectname subject4
Subjectname subject5

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
idShura, 2017-05-10
@idShura

First you need to group the data GROUP BY , and then sort ORDER BY
Example:

SELECT number1, title, theme, idea 
  FROM units 
 GROUP BY number1, title, theme, idea
 ORDER BY number1 ASC

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question