1
As it is a system that contains registration of Product Groups. I want to know how to make a select that brings me the information in the following order inside SQL and ordering everything alphabetically.
Summary: Lists a Group, then the Children Groups. Lists the next Group and below, its Children Groups.
EX:
- DRINKS (would be the Parent Group)
- SOFT DRINKS (would be the Grupo Filho);
- ÁGUAS (would be Grupo Filho);
- BEERS (would be the Son Group);
- LANCHES (would be the Parent Group)
- XIS (would be the Son Group);
- HOT DOG (would be the Son Group);
Table Grupoproduct grpDescGroup column
I think you need to post more information about the structure of your table, among them, how it is possible to identify the father’s children
– imex
Table: Groupproduct & #Xa;I use the columns: idGrupoProduct (PK), grpDescGroup, grpGroupProduct (FK - of the Groupproduct). I want to do a query where I can organize the contents from within that table. OBS: organizing everything alphabetically. Hence would be in the first line: DRINKS (would be the Parent Group) In the second line: WATERS (would be the Son Group); In the third line: BEERS (would be the Son Group); In the fourth line: SOFT DRINKS (would be the Son Group); But in the same table, also lists the other groups and their children as well.
– Ronaldo Gaston
Is there a limit to the amount of levels? A Child Group can be a parent?
– imex
Yes, in levels it would be. Father (Group) - Son (Subgroup) and at most one more son (Subgroup of the 1st Subgroup). That is, finishing in the 3rd level.
– Ronaldo Gaston