Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Query for interview

Author  Topic 

kamii47
Constraint Violating Yak Guru

353 Posts

Posted - 2006-03-19 : 11:00:54
i want to know that how can we select the nth maximum salary or any
numeric value from a column of a table which contain 1 or 5 lakh data in
oracle as well as sql server.

point to be noted we have to minimize the subqueries and this query is
able to get data for the nth value which is any postive number.

help me. this query is asked to me more than 5 interviews.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-03-19 : 12:25:41
well if you don't know it or don't know how to get to it maybe you're not fit for that job...

but to answer your question:
http://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspx
point 9

Go with the flow & have fun! Else fight the flow
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-20 : 01:25:37
[code]Select min(col) from
(
Select top N col from yourTable Order by col DESC -- Replace N by value
) T
[/code]Also refer this for more interview questions
http://vyaskn.tripod.com/iq.htm

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

DBASlut
Yak Posting Veteran

71 Posts

Posted - 2006-03-21 : 19:21:49
.. in an interview say this, 'you want me to solve a complex query problem that seems to plague a lot of companies without compensation? I may be beautiful, heck maybe even slutty but I'm not dumb. you want me to solve that, I charge 110.00 per hour for consulting.'
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-22 : 01:07:21


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-03-22 : 01:58:39
"I charge 110.00 per hour for consulting"

At that price you are definitely a slut, and you didn't get the job. Sorry ...

Kristen "Reassuringly expensive"
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-03-22 : 05:43:05
Lisa i think you need to post your pic so we can be objective about your sluttines

Go with the flow & have fun! Else fight the flow
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-03-22 : 05:55:01
"Object orientated sluttiness" ... hmmm ...
Go to Top of Page
   

- Advertisement -