Answer the question
In order to leave comments, you need to log in
How to get data from the database by groups?
Hello. Tell me this is the moment.
there is a database table:
id, group, title, description
it stores data:
1, 1, clock, gold watch
2, 1, clock, simple clock
3, 2, clock, cuckoo clock,
you need to display data from it in an html document by categories from the "group" column, so that it looks like this:
Wrist
-gold clock
-simple clock
Wall
-cuckoo clock
You can, of course, use several queries, but I would like one with automatic categorization.
Answer the question
In order to leave comments, you need to log in
If you just need a list of groups, then either from an external directory or distinct. If sorting by group before order by. group by groups data to get totals.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question