简体   繁体   中英

How can get the query result of order parent-child then paren-child in the table with parent-child relationship?

How can I get the query result as the picute below?

Text field is random text (not by alphabet order as the picture). 在此处输入图片说明

For the data you have presented, order by text works. However, that is probably not a general solution for what you want to do, unless the names of the nodes (as in your example) follow a very set pattern.

Order it in ascending order

SELECT *
FROM table_name
ORDER BY Text ASC 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM