🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.databases
1 messages
1 total messages Started by Dominik L�bbers Wed, 03 Feb 1999 00:00
Outer Joins in BDE - maybe a bug
#53
Author: Dominik L�bbers
Date: Wed, 03 Feb 1999 00:00
44 lines
1988 bytes
Using SQL-Language of the BDE the following problems occured:

Guess, we have 3 tables:
1) "Teachers" with a fields ID and a name
2) "Courses" with a field ID, a name and a Teacher-ID
3) "Students" with a field ID, a name and a Course-ID

For example these tables content the following data:
Teachers
========
ID  Name
99  Smith

Courses
=======
ID   Name     Teacher
1    Course 1

Students
========
ID   Name          Course
900  Bart Simpson  1

Notice, that no Teacher-ID is given in the Courses-Table.

In this situation the following SQL-Queries give a different result:
SELECT *
FROM
(Courses C INNER JOIN Students S ON S.Course=C.ID)
LEFT OUTER JOIN Teachers T ON C.Teacher=T.ID

SELECT *
FROM
(Courses C LEFT OUTER JOIN Teachers T ON C.Teacher=T.ID)
INNER JOIN Students S ON S.Course=C.ID

In the second case a sentence is given back, in the first case not.
Should'nt this be the same? And if not, why not?

Hoping, someone find the difference and tells me what to do.

Thanks

Dominik Luebbers
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads