SQLRNNR (11/18/2014)
Lynn Pettis (11/18/2014)
GilaMonster (11/18/2014)
Lynn Pettis (11/17/2014)
Even in single table queries I recommend using table aliases in the FROM clause and using that alias on the columns in the select list.I would go a bit further and recommend using sensible aliases. Aliasing tables A, B, C does nothing for clarity, exactly the opposite. The alias should be understandable, or at least I shouldn't have to check the FROM repeatedly to remind myself whether Customers or Orders is aliased B.
I actually agree with this statement. But I would also say it should be an abbreviation or acronym not the name of the table. I have used three to five letter aliases to identify tables Seems to work, at least where I am at the moment.
And since we are on the topic, I recommend using the same alias for a table every time it is aliased. Reduce the guessing games even further.
And I will also agree with this. Now, I have had to modify this on occasion when I had to join the same table 2 or 3 times in a query to get the answers we needed.