View Single Post
  #2  
Old February 28th, 2009, 06:22 PM posted to microsoft.public.access.queries
Sylvain Lafontaine[_2_]
external usenet poster
 
Posts: 247
Default Better "Join" vs "Where" clause?

Well, if you don't display any field from the second table when you are
joining two tables then yes, an INNER JOIN might give you the apparence that
it is doing the same job as a WHERE clause. Start displaying some fields
from the second table and you'll start to feel the difference between a JOIN
and a WHERE clauses.

For [], it's better not to use them because your code will be more readable;
however, if you have some special characters such as blank spaces, dot or $
in the name of your tables or fields then you must use them:

Select [My little table].[My first field] from [My little table] ...

Not sure but I think that you must also use them if the name of a table or
of a field is the same as of a reserved word; for example if you have a
field called Date instead of something less confusing like Date1, EndDate,
etc. When you'll have many tables and complexe relationships, using aliases
for your tables will also be a very good idea:

Select LT.[My first field] from [My little table] as LT ....

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain aei ca (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


wrote in message
...
2003, 2007


At the EOD, it appears that a WHERE clause accomplishes the same data set
as an [INNER] Join.

What are the benefits of one over the other?


Also, it does not appear that the use of [ or ] preceding / following
Table names and/or Field
names changes data set results.

Is the use of [ or ] a convention for reviewing code or are there
substantive issues in some
end-use cases?

TIA EagleOne