Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Performing Top-N Queries in Oracle-2 : Page 2


advertisement
Setting Up the Table
In this 10-Minute Solution, I am going to use table EMP in the queries examples of this article. This table belongs to the SCOTT schema of the Oracle starter database provided with Oracle database server versions 7.3, 8.0, and 8i.

Here is the table's structure:

Name Null? Type ----------- -------- ------------ EMPNO NOT NULL NUMBER(4) ENAME VARCHAR2(10) JOB VARCHAR2(9) MGR NUMBER(4) HIREDATE DATE SAL NUMBER(7,2) COMM NUMBER(7,2) DEPTNO NUMBER(2)

Let's start out by updating employee James (Empno = 7900) and setting his salary to NULL:


UPDATE Emp SET Sal = NULL WHERE Empno = 7900; COMMIT;

Now we'll look at the data in Emp table with 14 rows:

SELECT Empno, Ename, Job, Mgr, Hiredate, Sal FROM Emp;

Listing 1 shows the output of the above code.


Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date