Saturday, 31 March 2012


1) Create Table query
create table emp(eid number(20),ename varchar2(20),sal number(5))

2) Display nth highest salary from table :

SELECT DISTINCT (a.salary) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.salary)) FROM EMP B WHERE a.salary<=b.salary);

3) Versioning
select banner from v$version

4) Conversion :
select salary "Character",(to_char(to_date(salary,'j'), 'jsp')) "SALARYY" from emp

select ename "Name of Employees" from emp

No comments:

Post a Comment