Welcome to dbFreaks.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Inner Join vs Cartesian Product?

 
   Database Help (Home) -> Visual Basic RSS
Next:  Compiler error: Invalid outside procedure  
Author Message
U-CDK_CHARLESCharl

External


Since: May 24, 2004
Posts: 3



(Msg. 1) Posted: Thu Jun 03, 2004 4:07 pm
Post subject: Inner Join vs Cartesian Product?
Archived from groups: microsoft>public>vb>database (more info?)

List:

I've a query works correctly on my test dataset written one of two ways:

' All the AccountAccess records that have a matching user over here
SELECT AccountAccess.* FROM AccountAccess, [User List] WHERE
AccountAccess.User = [User List].[User Key]

SELECT AccountAccess.* FROM AccountAccess INNER JOIN [User List] ON
AccountAccess.User = [User List].[User Key]

Which is preferable? Why?

Thanx


Charles

 >> Stay informed about: Inner Join vs Cartesian Product? 
Back to top
Login to vote
Bob Butler

External


Since: Jul 07, 2003
Posts: 64



(Msg. 2) Posted: Thu Jun 03, 2004 4:15 pm
Post subject: Re: Inner Join vs Cartesian Product? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"U-CDK_CHARLES\Charles" <"Charles Krug"@cdksystems.com> wrote in
message news:O02m4ZaSEHA.1448@TK2MSFTNGP09.phx.gbl
 > List:
 >
 > I've a query works correctly on my test dataset written one of two
 > ways:
 >
 > ' All the AccountAccess records that have a matching user over here
 > SELECT AccountAccess.* FROM AccountAccess, [User List] WHERE
 > AccountAccess.User = [User List].[User Key]
 >
 > SELECT AccountAccess.* FROM AccountAccess INNER JOIN [User List] ON
 > AccountAccess.User = [User List].[User Key]
 >
 > Which is preferable? Why?

IMO the second separates the join specifications from the where conditions
and is much easier to work with.

--
Reply to the group so all can participate
VB.Net... just say "No"<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Inner Join vs Cartesian Product? 
Back to top
Login to vote
Utf-8BS2plbGw

External


Since: Jan 30, 2004
Posts: 29



(Msg. 3) Posted: Sun Jun 06, 2004 2:51 pm
Post subject: RE: Inner Join vs Cartesian Product? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I would go for the one using INNERJOIN because:

- It's updateable (edit and adding).
- I can very easily modify it to include a WHERE clause if needed later on.

I'm not sure about it's speed, but I think it's quicker.

PS. I always work with INNERJOIN (or Left - Right join) because I find it easier to read the SQL string.

Kjell
 >> Stay informed about: Inner Join vs Cartesian Product? 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]