Good night,
I'm not an expert in MySQL, I have 3 tables, but I can't find the way to join in a final table in a specific order.
Here are the 3 tables, and finally the last table as I want the final table. Thankyou
Table 1 (Joomla Users)
-------------------------------
|id(K)|username |email |
|-----|-----------|-----------|
|71 |JOHN |asd@go.com |
|-----|-----------|-----------|
|72 |ANA |sad@me.com |
|-----|-----------|-----------|
|73 |PETER |pet@mine.co|
|-----|-----------|-----------|
|74 |MARK |mark@nas.co|
|-----|-----------|-----------|
|75 |TONY |tony@gma.eu|
|-----|-----------|-----------|
Table 2 (ExtraFields)
-------------------------
|Field_id(K)| Title |
|-----------|-----------|
|1 |MARRIED |
|-----------|-----------|
|2 |CELL |
|-----------|-----------|
|3 |GENRE |
|-----------|-----------|
|4 |AGE |
|-----------|-----------|
|5 |WEBPAGE |
|-----------|-----------|
Table 3 (ExtraFields values)
-------------------------------------
|Field_id(K)|JoomlaId(K)|Value |
|-----------|-----------|-----------|
|1 |71 |YES |
|-----------|-----------|-----------|
|2 |71 |555-4565 |
|-----------|-----------|-----------|
|3 |71 |Male |
|-----------|-----------|-----------|
|4 |71 |34 |
|-----------|-----------|-----------|
|5 |71 |www.go.com |
|-----------|-----------|-----------|
|1 |75 |NO |
|-----------|-----------|-----------|
|3 |72 |Female |
|-----------|-----------|-----------|
|5 |72 |www.me.com |
|-----------|-----------|-----------|
|4 |74 |38 |
|-----------|-----------|-----------|
|3 |74 |Male |
|-----------|-----------|-----------|
|1 |73 |NO |
|-----------|-----------|-----------|
|2 |73 |234-5654 |
|-----------|-----------|-----------|
|3 |75 |MALE |
|-----------|-----------|-----------|
Desired Resultant table ( i don't know hoe=w to do it)
----------------------------------------------------------------------------------
|id(K)|username |email |Married |Cell |Genre |Age |WebPage |
|-----|-----------|-----------|--------|---------|-------|-------|---------------|
|71 |JOHN |asd@go.com |YES |555-4565 |Male |34 |www.go.com |
|-----|-----------|-----------|--------|---------|-------|-------|---------------|
|72 |ANA |sad@me.com |NO | |Female | | |
|-----|-----------|-----------|--------|---------|-------|-------|---------------|
|73 |PETER |pet@mine.co|NO |234-5654 | | | |
|-----|-----------|-----------|--------|---------|-------|-------|---------------|
|74 |MARK |mark@nas.co| | |Male |38 | |
|-----|-----------|-----------|--------|---------|-------|-------|---------------|
|75 |TONY |tony@gma.eu|NO | |Male | | |
|-----|-----------|-----------|--------------------------------------------------|