Question : normally this question asked that write the query for nth highest sal ?
Answer: u use any one of them
1. select distinct a.salary from Salary a where 5=( select count(distinct b.salary) from Salary b where a.salary<=b.salary)
------------------------------------------------------
2.
Answer: u use any one of them
1. select distinct a.salary from Salary a where 5=( select count(distinct b.salary) from Salary b where a.salary<=b.salary)
------------------------------------------------------
2.
Select top 1 salary from (
Select Distinct top n salary
from employee
order by salary desc) a
order by salary
---------------------------------------
3.SELECT distinct salary FROM
(
SELECT DENSE_RANK() OVER (ORDER BY salary DESC) AS rank, salary
FROM property_R
) T2
WHERE rank=1
hello Rohit i didn't get what you have done. Can you please do it with the help of asp .net as i am an asp .net programmer.
ReplyDeleteHi vivek above are three simple SQL Server query.
ReplyDeleteU can make a store procdure and call this in your ASP .net page .
if any confusion then let me know