Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to find the second highest salary from emp table?

Answer Posted / priya

select sal from emp where sal <(select max(sal) from emo)
and rownum<2 order by desc


though rownum which is a pseudo column can be used for
comparisions with relational operators like > or < ,>=, <=
but equalto = may not work in most of the cases..
similarly rowid also.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What can I use instead of union in sql?

902


Is a foreign key always unique?

882


How many tables can a sql database have?

924


What are different types of triggers?

1025


What is pl sql variable?

935


Is join and inner join the same?

940


What steps server process has to take to execute an update statement?

919


How do you optimize a stored procedure query?

936


What is cte?

923


Define implicit and explicit cursors.

1073


Can triggers stop a dml statement from executing on a table?

1023


What type of join is sql join?

921


Where the sql database files are stored?

955


How to call a javascript function from pl sql?

1065


Why procedure is used in sql?

968