Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
How To Add a New Column to an Existing Table
How To Add a New Column to an Existing Table? - Oracle DBA FAQ - Understanding SQL DDL Statements
✍: FYIcenter.com
If you have an existing table with existing data rows, and want to add a new column to that table, you can use the ALTER TABLE ... ADD statement to do this. Here is an example script:
SQL> connect HR/fyicenter Connected. SQL> CREATE TABLE emp_dept_110 2 AS SELECT * FROM employees WHERE department_id=110; Table created. SQL> ALTER TABLE emp_dept_110 ADD (vacation NUMBER); Table altered. SQL> SELECT first_name, last_name, vacation 2 FROM emp_dept_110; FIRST_NAME LAST_NAME VACATION -------------------- ------------------------- ---------- Shelley Higgins William Gietz
This SQL script added a new column called "vacation" to the "emp_dept_110" table. NULL values were added to this column on all existing data rows.
2007-04-22, 4669👍, 0💬
Popular Posts:
How does one iterate through items and records in a specified block? One can use NEXT_FIELD to itera...
Can one change the mouse pointer in Forms? The SET_APPLICATION_PROPERTY build-in in Oracle Forms all...
What is shadowing ? When two elements in a program have same name, one of them can hide and shadow t...
What Articles Have You Read about JUnit? There are a number of JUnit articles that you should read: ...
Can you explain project life cycle ? Figure :- 12.2 Life cycle of a project There are five stages of...