Help pliz build a query to mysql and display the info. thank you )

There is a table like this:

id cat name
1 item_1
2 item_2
3 item_3
4 1 Subclause_1.1
5 2 Subclause_2.1
6 2 Subclause_2.2
7 2 Subclause_2.3
8 3 Subclause_3.1
9 3 Subclause_3.2

You need to display the info like this:

clause_1 -clause_1.1
item_2 -Sub-item_2.1
item_2 -Sub-item_2.2
item_2 -Sub-item_2.3
paragraph_3 -Subparagraph_3.1
item_3 -Sub-item_3.2

And what's the problem with linking two copies of the table?

Akina2021-10-13 13:53:04

if the data was stored in different tables, would you have a question like this?

teran2021-10-13 14:05:27

he has such questions since 2017))

Jean-Claude2021-10-13 14:19:48