datetime tune date into pad dynamic cursor money percent sp job isnumeric while over update
FREE TRIAL  SQL 2012 PROGRAMMING  SEARCH
SQL Server Scripts SQL 2005 SQL 2008 Articles
SQL JOBS NEWS FORMAT DEV JOBS
How to list the top 5 percent?

Execute the following SQL Server T-SQL scripts in SSMS Query Editor to list the top 5 percent result set with ties and without ties:

USE AdventureWorks;

 

SELECT   TOP ( 5 ) PERCENT WITH TIES Employee = FirstName + ' ' + Lastname,

                                     e.Title,

                                     Gender,

                                     Rate

FROM     HumanResources.Employee e

         JOIN HumanResources.EmployeePayHistory eph

           ON e.EmployeeID = eph.EmployeeID

         JOIN Person.Contact c

           ON c.ContactID = E.ContactID

ORDER BY Rate DESC;

GO

-- (16 row(s) affected)

 

SELECT   TOP ( 5 ) PERCENT Employee = FirstName + ' ' + Lastname,

                           e.Title,

                           Gender,

                           Rate

FROM     HumanResources.Employee e

         JOIN HumanResources.EmployeePayHistory eph

           ON e.EmployeeID = eph.EmployeeID

         JOIN Person.Contact c

           ON c.ContactID = E.ContactID

ORDER BY Rate DESC;

GO

-- (16 row(s) affected)

 

Exam Prep 70-461
Exam 70-461