QOD 17/12/03 (WRONG ANSWER)

  • Your company is about to layoff 5 percent of its sales force and you have been tasked with the morbid task of determining which of your salespeople are poor performers. To do this, you're required to find the bottom 5% of your sales force based on their total sales (TOTAL_SALES column). What T-SQL statement would accomplish this?

    As per this Q. they want to have a list of 5% of people who have poor performance.

    But as per the Answer

    SELECT TOP 5 PERCENT FIRST_NAME, LAST_NAME

    FROM Sales ORDER BY TOTAL_SALES DESC

    This will give wrong answer because it will fetch those records which will have maximum Total_Sales because of this "ORDER BY TOTAL_SALES DESC ".

    Please correct me if I am wrong.

    Sudhir Chawla


    Sudhir Chawla

  • No, you're not wrong, but please use this thread to complain

    http://www.sqlservercentral.com/forum/link.asp?TOPIC_ID=19291

    Frank

    http://www.insidesql.de

    http://www.familienzirkus.de

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • But this one has the correct date

    Keith Henry

    DBA/Developer/BI Manager




    Keith Henry



    According to everyone I know I "do something with computers?" for a living, so there you go.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply