I have a stored procedure in which I would like to return a result set looking something like this:
id | student | term1 | term2
The problem is that the data isn’t stored like this in the db. So the query will generate a result set looking something like this:
id | student | termNo | termValue
1 | lorem | 1 | someValue
2 | ipsum | 2 | anotherValue
Is there any simple way to convert this. The result sets is large, so I don’t want to make several queries which would be the obvious solution.
Hope this is understandable =)
Ok, based on your comment, you can do this:
or