|
The problem: Unless you want to return the SAME NUMBER of courses for each user, you can't do this in SQL.
That is you could *NOT* get back:
[1][jdoe][John][Doe][01-29-2012]
[2][adam][Adam][And][12-31-2012][2-29-2012][3-31-2012]
because you can not have a different number of columns per row.
You *could* do this with a combination of SQL and PHP/JSP/ASP code.
Or you would get back a *list* of dates (say comma delimited) as a single column:
[1][jdoe][John][Doe][01-29-2012]
[2][adam][Adam][And][12-31-2012,2-29-2012,3-31-2012]
Though I don't understand how you will interpret that if you don't know what date goes with what course.
Now, in your example, you showed exactly *two* courses, 1 with "no result". If you want exactly two courses for each person, *that* we can do, although it's not trivial at all.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
|