In SQL Server 2005, we can use RANK() to display rank order in the result set.
However, assume that we don't know that, we can use the simple query as the following:
SELECT COUNT(*) AS Rank, t1.EmployeeID, t1.EmployeeName
FROM Employee t1, Employee t2
WHERE t1.EmployeeID >= t2.EmployeeID
GROUP BY t1.EmployeeID, t1.EmployeeName
Wednesday, January 6, 2010
Rank order by using simple query
at 6:22 AM
Labels: MySQL, MySQL Query, Oracle, Oracle Query, SQL Server, SQL Server Tip
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment