I do this query:
SELECT idFormacion FROM alumnos_formacion
And I get this:
|idFormacion|
-------------
6
9
12
My question is whether a query can be made to put each row obtained into independent columns.
|idFormacion1| |idFormacion2| |idFormacion3|
------------- ------------- -------------
6 9 12
I don't know if this will be possible.
This kind of ways of displaying the data I understand that it is much better to solve it in the data view and not in the SQL logic, @A. Cedano is a good starting point. However, there may be cases in which it is mandatory to resolve it from the query itself. One way to do it would be the following:
Let's see:
IdFormacion
thealumnos_formacion
. This query makes sense if we only have different formations, that is, if, as I suppose, this table also has aid
student, I imagine that the query should be done byalumno
.MAX
and aCASE
each of theformaciones
in the indicated column.Important: