Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > ORACLE , SQL SERVER , SYBASE & Others > Oracle Interview / Technical Questions
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

Oracle Interview / Technical Questions Kindly solve an many as questions you can. It will sharpen your skills and those solutions will help others too.

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 09-05-07, 08:54 AM   #1 (permalink)
Junior Member
 
Join Date: Aug 2006
Posts: 15
Thanks: 5
Thanked 1 Times in 1 Posts
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 3 sumahalesh28 is on a distinguished road
Smile query to find 2nd or 3rd maximum salary from emp table

Hi friends,

Plse tel me the query to find the second and third maximum salary from emp table.

Thanks
suma
sumahalesh28 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to sumahalesh28 For This Useful Post:
Payal_Maheshwari (06-06-08)
Old 09-05-07, 12:48 PM   #2 (permalink)
Super Moderator
 
sk_kireeti's Avatar
 
Join Date: Feb 2006
Location: Hyderabad
Posts: 2,355
Thanks: 117
Thanked 241 Times in 198 Posts
Thanks: 117
Thanked 241 Times in 198 Posts
Blog Entries: 4
Rep Power: 51 sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute
Re: oracle query

this is duplicate post...
n th max/min using SQL
__________________
Give 1 cup rice to a hungry Indian just by a mouse click. No money, no form filling, no hassle... Click here for the donation.
sk_kireeti is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to sk_kireeti For This Useful Post:
sumahalesh28 (09-05-07)
Old 28-09-07, 02:24 PM   #3 (permalink)
Junior Member
 
Join Date: Sep 2007
Age: 23
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2 Jagadish chandra sabata is on a distinguished road
Smile Re: oracle query

Quote:
Originally Posted by sumahalesh28 View Post
Hi friends,

Plse tel me the query to find the second and third maximum salary from emp table.

Thanks
suma
select * from emp e where
2 =(select count(distinct sal) from emp where e.sal<=sal)
or 3=(select count(distinct sal) from emp where e.sal<=sal);
Jagadish chandra sabata is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 28-09-07, 02:26 PM   #4 (permalink)
Junior Member
 
Join Date: Sep 2007
Age: 23
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2 Jagadish chandra sabata is on a distinguished road
Re: oracle query

check my query .

if any moore query please inform me
Jagadish chandra sabata is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-06-08, 02:15 PM   #5 (permalink)
Junior Member
 
Join Date: Nov 2007
Age: 25
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2 pradeep_kumar is on a distinguished road
Re: query to find 2nd or 3rd maximum salary from emp table

ok friend do not worry i am sending one query for you .you try this.


select * from emp e where
2 =(select count(distinct sal) from emp where e.sal<=sal)
or 3=(select count(distinct sal) from emp where e.sal<=sal);


if you got the answer ok.otherwise u can send another thread to me .my mail id is:pradeep.tanugula@gmail.com.Please put subject as oracle query for second or third max salary.


Best of Luck.
byeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee....

TANUGULA PRADEEP
pradeep_kumar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-09-08, 03:40 PM   #6 (permalink)
Junior Member
 
Join Date: Sep 2008
Age: 25
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
Thanks: 3
Thanked 0 Times in 0 Posts
Blog Entries: 2
Rep Power: 1 pallavi.patil is on a distinguished road
Post oracle query

how to find employee information whose salary is second highest salary in his department

my mail id : patil.pallavi@gmail.com
pallavi.patil is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL query to display maximum number of rows(not records) in a table? chytrahs ORACLE , SQL SERVER , SYBASE & Others 1 25-01-07 02:23 AM


All times are GMT +6.5. The time now is 09:32 PM.





Search Engine Optimization by vBSEO 3.1.0