i have one table.that contains one salary field.I want to find the third maximum row from that field.If anyone knows this please help me
thanks
Jump to Posthmmm,
SELECT MIN(column) FROM table WHERE ( SELECT TOP 3 (column) FROM table ORDER BY column desc )
Jump to PostRamyMahrous' solution doesn't work. Use this instead. select min(s.column) from (SELECT TOP 3 (column) FROM table ORDER BY column desc) s
select top 3 COLUMNAME from TABLENAME order by COLUMNAME desc
The first row will be your third highest paid person.
hmmm,
SELECT MIN(column) FROM table WHERE ( SELECT TOP 3 (column) FROM table ORDER BY column desc )
go with the whiz... :)
@erictenson:
sorry??
@erictenson:
sorry??
:) RamyMahrous -> Posting Whiz! Thats what he meant, I guess.
RamyMahrous' solution doesn't work. Use this instead. select min(s.column) from (SELECT TOP 3 (column) FROM table ORDER BY column desc) s
Yes, yes I am sorry I was wrong thanks, pclfw :)
yours soln is very useful for my solution.I join dis community bcz of ur answer
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.