home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!uwm.edu!ux1.cso.uiuc.edu!news.cs.indiana.edu!nstn.ns.ca!ac.dal.ca!pchua
- From: pchua@ac.dal.ca
- Newsgroups: comp.databases
- Subject: FoxPro 2.0 SQL - outer join
- Message-ID: <1992Sep4.164144.7346@ac.dal.ca>
- Date: 4 Sep 92 13:41:44 GMT
- Article-I.D.: ac.1992Sep4.164144.7346
- Organization: Dalhousie University, Halifax, Nova Scotia, Canada
- Lines: 39
-
- I am trying to use FoxPro 2.0 SQL to perform a Master/Detail join (or
- left outer natural join) for my application reports but having
- difficulty to do so. Let say I have a Master table STUDENT with
- fields id, lastname, firstname and a Detail table COURSE with fields id,
- courseid. The following is my SQL command:
-
- SELECT student.id, ;
- student.lastname, ;
- student.firstname, ;
- course.courseid ;
- FROM student, ;
- course ;
- WHERE student.id = course.id ;
-
- UNION ;
-
- SELECT student.id, ;
- student.lastname, ;
- student.firstname, ;
- '' AS courseid ;
- FROM student ;
- WHERE NOT EXISTS ;
- ( ;
- SELECT * ;
- FROM course ;
- WHERE student.id = course.id ;
- )
-
- The problem is at "'' AS courseid". I am not sure what is the syntax in
- FoxPro to assign an empty string for courseid. Any suggestion?
-
- My other concern is the performance of the outer join. Besides
- introducing redundency control by maintaining a detail existence flag
- for each master row , are there any other approaches? Suggestions would
- be appreciated.
-
-
- Poh Chua (e-mail: PCHUA@AC.DAL.CA)
- Dalhousie University
-