View Single Post
  #5  
Old February 28th, 2009, 08:31 PM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 308
Default Better "Join" vs "Where" clause?

Thanks Sylvain

"Sylvain Lafontaine" wrote:

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 ....