Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Rename a Column in an Existing Table
How To Rename a Column in an Existing Table? - Oracle DBA FAQ - Managing Oracle Database Tables
✍: FYIcenter.com
Let's say you have an existing with an existing column, but you don't like the name of that column, can you rename that column name? The answer is yes. You can use the ALTER TABLE ... RENAME COLUMN statement to do this. See the following SQL script:
SQL> CREATE TABLE emp_dept_90 2 AS SELECT * FROM employees WHERE department_id=90; Table created. SQL> SELECT first_name, last_name FROM emp_dept_90; FIRST_NAME LAST_NAME -------------------- ------------------------- Steven King Neena Kochhar Lex De Haan SQL> ALTER TABLE emp_dept_90 RENAME COLUMN first_name 2 TO fname; Table altered. SQL> SELECT fname, last_name FROM emp_dept_90; FNAME LAST_NAME -------------------- ------------------------- Steven King Neena Kochhar Lex De Haan
As you can see the column "first_name" is nicely changed to "fname".
2007-05-03, 4970👍, 0💬
Popular Posts:
what are the advantages of hosting WCF Services in IIS as compared to self hosting? There are two ma...
What is ISO? ISO 9000 is a family of standards for quality management systems. ISO 9000 is maintaine...
How To Control Table Widths? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells Usually, b...
How To Enter Binary Numbers in SQL Statements? - MySQL FAQs - Introduction to SQL Basics If you want...
.NET INTERVIEW QUESTIONS - Where do you specify session state mode in ASP.NET ? The following code e...