Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query Alias
Message
De
30/07/2018 13:04:47
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/07/2018 00:00:56
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
01661376
Message ID:
01661379
Vues:
52
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform