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...

find out the second highest salary?

Answer Posted / elumalai d

CREATE TABLE emp(ID NUMBER(10),NAME VARCHAR2(100),salary NUMBER(10));

INSERT INTO emp VALUES(100,'Steven',40000);
INSERT INTO emp VALUES(101,'Smith',30000);
INSERT INTO emp VALUES(102,'Ranshow',70000);
INSERT INTO emp VALUES(103,'Handscomp',20000);
INSERT INTO emp VALUES(104,'Mitchel',10000);
INSERT INTO emp VALUES(105,'Clarke',90000);
INSERT INTO emp VALUES(106,'Ponting',50000);
INSERT INTO emp VALUES(107,'Clarke',80000);
INSERT INTO emp VALUES(108,'Marsh',60000);
COMMIT;

SELECT salary FROM emp ORDER BY salary DESC;

--Records
--======
90000
80000
70000
60000
50000
40000
30000
20000
10000

SELECT min(salary) FROM (SELECT salary FROM emp ORDER BY salary DESC) WHERE ROWNUM<3;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

State some uses of redo log files?

1007


What is SQL Tuning Advisor in Oracle?

1179


What is the difference between view and materialized view in Oracle?

1154


How to name query output columns in oracle?

1187


Is oracle a language?

946


How can we delete duplicate rows in a table?

973


What privilege is needed for a user to connect to oracle server?

994


What is the difference between hot backup and cold backup in oracle? Tell about their benefits also.

979


What is the fastest query method to fetch data from the table?

1361


For a field in a repeating frame, can the source come from the column which does not exist in the data group which forms the base for the frame ?

2025


How to write a query with a left outer join in oracle?

1065


What are the differences between char and nchar in oracle?

1096


How to bring a tablespace offline?

1064


What to do if dba lost the system password?

1172


defination of bitmap index

2124