SQL Queries

SELECT max(salary) FROM Employee WHERE salary NOT IN (SELECT max(salary) FROM Employee)

SELECT MAX(Salary) From Employee WHERE Salary < ( SELECT Max(Salary) FROM Employee);

select max(MERCHANT_NBR) from WEBSITE_MERCHANT_ACTY where MERCHANT_NBR Not in(select max(MERCHANT_NBR) from WEBSITE_MERCHANT_ACTY)

select MERCHANT_NBR from (select rownum r ,MERCHANT_NBR from WEBSITE_MERCHANT_ACTY) where r=1

select MERCHANT_NBR from (select rownum r ,MERCHANT_NBR from WEBSITE_MERCHANT_ACTY order by MERCHANT_NBR asc ) where r=1

select merchant_nbr from
(select DENSE_RANK() OVER(ORDER BY MERCHANT_NBR desc) r,MERCHANT_NBR from WEBSITE_MERCHANT_ACTY  )  where r=1

No comments:

Post a Comment