Buon pomeriggio.
Ho due tabelle TB_LIVELLO_1 e TB_LIVELLO_2
Nella prima:
id_livello(PK) - Principale
1 - Disposizioni
2 - Strumenti
3 - Consulenti
Nella seconda:
id(PK) - il_livello(K) - Secondaria
1 - 1 - personale
2 - 2 - chitarra
3 - 2 - basso
4 - 2 - batteria
5 - 2 - microfono
6 - 3 - PRS
7 - 3 - IBANEZ
Eseguo questa query:
codice:
SELECT c.vPrincipale , a.vSecondaria,a.id_livello FROM TB_LIVELLO_1 AS c
LEFT JOIN TB_LIVELLO_2 AS a ON c.id_livello = a.id_livello
order by c.id_livello ASC
e mi restituisce:
vPrincipale - vSecondaria
Disposizioni - personale
Strumenti - chitarra
Strumenti - basso
Strumenti - batteria
Strumenti - microfono
Consulenti - PRS
Consulenti - IBANEZ
Il menu che devo ottenere è cosi strutturato:
Disposizioni
- personale
Strumenti
- chitarra
- basso
- batteria
- voce
Consulenti
- PRS
- IBANEZ
La query è giusta oppure no?
Grazie mille.