doubt with sql pivot

1

I have a table of potatoes

idpapapa| nombrepapa| 
0001    |  fernando |
0002    |    otro papa|

and one of students where with the following info

idhijo| id papa | nombre hijo
1    |     0001  |  rebeca
2    |    0001   |  ruben

How can I make a query that accommodates my columas in the following way?

idpapa  |   nombre papa|  hijo 1 |hijo 2 
0001   |   fernando    |rebeca   | ruben

from what I have found it can be pivoted, but I can not make it work

    
asked by Fernando Tovar 04.07.2018 в 23:35
source

0 answers