Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Alias
Message
From
30/07/2018 13:04:47
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
30/07/2018 00:00:56
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
01661376
Message ID:
01661379
Views:
51
>Hi all
>
>this is a silly query, I know. But, I just want to know what is the purpose of "MyAlias" as the end of the query?
>
>select * from
>(
> select hired from employee where hired between '2011-1-5' and '2015-12-31'
>) MyAlias
>
>
>TIA

Every subquery must have an alias to refer to the result columns from there. Without that alias, the query is invalid and throws an error. (Subqueries that doesn't need to reference columns from within doesn't have a alias. ie: ... where myColumn in (select someCOlumn from someTable))
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform