Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid column name
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00368854
Message ID:
00369299
Views:
16
>It worked like a champ, but what does "As a" do?

This query uses a derived table. In the FROM clause I've specified a query. The AS a give the results of the query an alias. It's similar to:

select a.au_lname, a.au_fname from authors a

Again 'a' is an alias. This time for the authors table.

>Why did mine not work?

I's kind of strange but the column 'alpha' doesn't exist during the execution of the query. It's a column heading that's assigned when the results are being pulled together. The ORDER BY clause get around this by allowing you to specify the column by ordinal position.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform