>>>There is one important problem in this code sample - the OrderDate is not prefixed with the alias. Without that we would need to check which table this column belongs to.
>>>My rule of thumb - prefix every column with an alias name when the query involves more than 1 table.
>>
>>I don't disagree with the rule of thumb, especially with several tables. But with 2 tables (a business entity master and a child table of
orders), any question about the lineage of
OrderDate is more likely a problem with the person in the chair. :)
>>
>
>The rule is the rule - and I always follow it.
I realize words can have multiple meanings, but an example of a rule is referencing a column that belongs to multiple tables in a query - in that situation, you must specify the table alias, or you'll get an ambiguity error.
What you're describing is a practice. (And certainly a good one). If you always follow it, that's great. Not everyone does (even Microsoft generated SQL queries don't always do it when a column is unique to a table).
I'll say this - I see some people (not you) who use meaningless one letter table alias designations. This one is royally stupid.
SELECT a.Column1, a.Column2, b.Column3, c.Column4
from Table1 A
join Table2 B
join Table3 C