Allegiance

 
Thoughts

When I Asked God for Strength
He Gave Me Difficult Situations to Face

When I Asked God for Brain & Brown
He Gave Me Puzzles in Life to Solve

When I Asked God for Happiness
He Showed Me Some Unhappy People

When I Asked God for Wealth
He Showed Me How to Work Hard

When I Asked God for Favors
He Showed Me Opportunities to Work Hard

When I Asked God for Peace
He Showed Me How to Help Others

God Gave Me Nothing I Wanted
He Gave Me Everything I Needed

          - Swami Vivekananda

Links
Bhajana Sampradaya
Links
Your External IP Address
Clock
Advertisements
Social Bookmarking

    Socialize it!
SQL Query For Finding N th maximum of table
Wednesday, September 5, 2007
Below is the query to find the N th maximum salary of the Tbl_Employee table.

SELECT * FROM Tbl_Employee E1 WHERE (N-1) = ( SELECT COUNT(DISTINCT(E2.Fld_Salary))FROM Tbl_Employee E2 WHERE E2.Fld_Salary > E1.Fld_Salary )

Example :
---------

Below is the sql query for getting 3 rd maximum of table ...

SELECT * FROM Tbl_Employee E1 WHERE (3 -1) = ( SELECT COUNT(DISTINCT(E2.Fld_Salary))FROM Tbl_Employee E2 WHERE E2.Fld_Salary > E1.Fld_Salary )
posted by Senthil kumar T @ 3:48 AM   0 comments
About Me

Name: Senthil kumar T
Home: Madurai, Tamil Nadu, India
About Me: Name: Senthil kumar T Location: Madurai, TamilNadu, India
See my complete profile
Previous Post
Archives
Links
Powered by


BLOGGER

© 2007 Allegiance