I have these three tables;
table_1 |---------------------| | ID1 | name | |---------------------| | 1 | 'xxxxx' | | 2 | 'xxxxxx' | | 3 | 'xxxxxxxx' | | 4 | 'xxxxxx' | | 5 | 'xxxxxx' | |---------------------| table_2 |---------------------| | ID2 | date | |---------------------| | 1 | '1a' | | 2 | '2b' | | 3 | '3c' | |---------------------| table_3 |--------------------------------------| | ID2_fk | valu | ID1_fk | |--------------------------------------| | 1a | 'value1' | 1 | | 2b | 'value2' | 1 | | 3c | 'value3' | 3 | |--------------------------------------|
And I need to show something similar to this:
Eu preciso de um select que mostra isso
|------------------------------------------------------|
| ID1 | name | 1a | 2b | 3c |
|------------------------------------------------------|
| 1 | 'xxxxx' | 'value1' | 'value2' | |
| 2 | 'xxxxxx' | | | |
| 3 | 'xxxxxxxx' | | | 'value3' |
| 4 | 'xxxxxx' | | | |
| 5 | 'xxxxxx' | | | |
|------------------------------------------------------|
How do I? Remember that table_2 varies.