Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> SQL for spreadsheet output - Part 2
Continuing from my post a few days ago, I want to produce a list of
people and the qualificatons they have obtained. I have two tables in
a Oracle 9i database:
TblPerson { PersonId(PK), PersonName, PersonSurname, PersonTel } TblEducation { QualificationId, PersonId(FK), QualificationName, DateObtained }
One person can have multiple qualifications. In this instance it doesn't matter that a particular qualification can be obtained by more than one person and I don't need to cater for that possibility.
As per my original post I want to generate an excel spreadsheet of
Persons
and the qualifications they have obtained.
I want the spreadsheet to be laid out as follows if the person only has one qualification:
PersonId | PersonName | PersonSurname| PersonTel | QualificationId | QualificationName | DateObtained
If the person has two qualifications it will look like this:
PersonId | PersonName | PersonSurname| PersonTel | QualificationId |
QualificationName | DateObtained | QualificationId | QualificationName
| DateObtained
And for three qualifications:
PersonId | PersonName | PersonSurname| PersonTel | QualificationId |
QualificationName | DateObtained | QualificationId | QualificationName
| DateObtained | QualificationId | QualificationName | DateObtained
And so on for more qualifications.
How do I get this result? Received on Wed Jul 28 2004 - 11:40:20 CDT