Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8366265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:52:25+00:00 2026-06-09T12:52:25+00:00

What is the advantage of using select clause in the from clause over normal

  • 0

What is the advantage of using select clause in the from clause over normal select clause ?. For ex.

select name, age, address from emp where 
 empid = 12.

what is the advantage of below query over above query.

 select A.name, A.age, A.address from (select
  * from emp where empid = 12) as A.

The inner query creates a temp view and from that result, the fields in the first query selected. Right ?. But the query mentioned in the top of this question can also be used to get the same result.

What is the advantage? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:52:27+00:00Added an answer on June 9, 2026 at 12:52 pm

    One way this technique can be used to derive results in the inner query that you don’t want presented in the outer query. A simple example, I want to see the oldest person in each household, here is one way to do it:

    SELECT name, age, address FROM
    ( 
      SELECT name, age, address, 
        rn = ROW_NUMBER() OVER (PARTITION BY address ORDER BY age DESC)
      FROM dbo.emp
    ) AS x
    WHERE rn = 1;
    

    This way the derived column (a ranking, essentially, of household members by age, oldest first) does not need to be a column in the result set (and this also makes it convenient for filtering).

    And I’m sure there are plenty of others (such as not having to repeat elaborate expressions); this was just the first one that came to mind.

    In the case you posted in your question, I don’t see an advantage at all. If you post a real example, where someone said there was an advantage, we might be able to explain why (or at least why they may have thought that).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What's the advantage of using malloc (besides the NULL return on failure) over static
I create indexes without the USING BTREE clause. Is there any advantage of using
Consider the following SQL Server 2005/2008 query: Select [UID], [DESC] From SomeTable Order By
I'm wondering if there is any particular performance advantage in using LIKE over NOT
I have this MySQL query that I'd like to optimize: SELECT min(`topic_id`) FROM `gallery_topics`
Is there an advantage of using Cross apply over case statements? For example as
Is there any advantage of using XAMPP compiled with VC9 as compared to one
Is there any advantage of using int vs varbinary for storing bit masks in
I understand the advantage of using RegexOptions.Compiled - it improves upon the execution time
I'm struggling to understand the advantage of using the orange circle view controller in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.