Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> SQL for spreadsheet output

SQL for spreadsheet output

From: Luis <andyza_at_webmail.co.za>
Date: 23 Jul 2004 07:42:45 -0700
Message-ID: <69476b6f.0407230642.51b62a4d@posting.google.com>


I have a Oracle 9i database with two tables eg.:

TblStudent { StudentId(PK), StudentName, StudentSurname, StudentTel } TblCourse { CourseId(PK), StudentId(FK), CourseName, CourseDate, Result }

The relationship between TblStudent and TblCourse is a 1:M relationship, that is, one student can do many courses.

I'm using an .asp page to generate an excel spreadsheet of students and the courses they have completed. I want the spreasheet to be laid out as follows:

StudentId | StudentName | StudentSurname | StudentTel | CourseId | CourseName | CourseDate | Result

If the student has taken more than one course it will look like this:

For two courses:
StudentId | StudentName | StudentSurname | StudentTel | CourseId | CourseName | CourseDate | Result | CourseId | CourseName | CourseDate
| Result

For three courses:
StudentId | StudentName | StudentSurname | StudentTel | CourseId | CourseName | CourseDate | Result | CourseId | CourseName | CourseDate
| Result | CourseId | CourseName | CourseDate | Result

How do I structure my sql statement so that I get this result? Received on Fri Jul 23 2004 - 09:42:45 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US