Skip to content
Advertisement

Why Select Distinct stored ‘As T’ and how to alias?

From this helpful response on another question on stackoverflow.com (How do I count unique items in field in Access query?), the answer contained:

Why is the distinct selection aliased “As T” (i.e. not why the letter T, but why do this?)

If you had the case of:

How could you also alias the long table name?

Advertisement

Answer

Because MS Access requires that every “object” referred to in the FROM clause has a name. Tables have a default name — which is their name. (Actually, you can use either multi-part name or just the table name.)

As for your second query:

This will result in a syntax error because Long_Table_Name_Here is not defined. You need to use the table alias defined in the FROM clause:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement