.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

Tippical Interview Querries

Posted By: venu     Posted Date: July 04, 2011    Points:5   Category :Sql Server
HI Friends!

Can any one give me the tippical interview querries like find the 3rd employee salary with out using top et..c




Thanks & Regards
------------------
Venu

Responses
Author: Gowthammanju             
Posted Date: July 05, 2011     Points: 20   

hey try these as


SELECT min(sal) FROM (SELECT sal FROM emp WHERE sal IS NOT NULL ORDER BY sal DESC) WHERE rownum<=&rownum


Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Dhiraj Ranka             
Posted Date: July 05, 2011     Points: 20   

Hi,

Try this


select * from employee emp where
3=(select count(distinct salary) from employee where emp.salary<=salary);


Hope this helps

Hope this helps.

Thanks & Regards,
Dhiraj Ranka
http://www.twitter.com/dhirajranka | http://www.dhirajranka.com


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend