sql - Why is "AS emp" needed in this query -


select top 1 salary (        select top 3 salary         employees         order salary desc) emp   order salary asc 

why "as emp" used in query? query not work without using as.

the reason because need alias subquery. think of subquery creating table select , query trying reference it. might not going on, helps me justify why have add alias @ end.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -