SQL syntax question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
This SQL statement returns the same result twice even though there is
only one matching entry in the first table "tbl_Drivers" and none in
the second table. Can anyone explain why? I would appreciate it very
much. I am trying to improve my understanding of SQL.

SELECT * FROM tbl_Drivers Drvs, tbl_Del_Drivers DelDrvs where
(Drvs.FName = 'Larry' AND Drvs.LName = 'Smith') OR (DelDrvs.FName =
'Larry' AND DelDrvs.LName = 'Smith');

Re: SQL syntax question

Tenacious wrote:
Quoted text here. Click to load it

Since you have given no conditions relating the two table, it's a "cross
join".  See http://en.wikipedia.org/wiki/Cross_join#Cross_join

Bill K.

Site Timeline