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 an Existing Column in a Table
How To Rename an Existing Column in a Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements
✍: FYIcenter.com
If you have an existing column in a table and you want to change the column name, you can use the "ALTER TABLE ... CHANGE" statement. This statement allows you to change the name of a column, and its definition. The tutorial script below gives you a good example:
mysql> ALTER TABLE tip CHANGE COLUMN subject title VARCHAR(60); Query OK, 1 row affected (0.51 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> SHOW COLUMNS FROM tip; +-------------+--------------+------+-----+---------+------- | Field | Type | Null | Key | Default | Extra +-------------+--------------+------+-----+---------+------- | id | int(11) | NO | PRI | | | title | varchar(60) | YES | | NULL | | description | varchar(256) | NO | | | | author | varchar(40) | YES | | NULL | +-------------+--------------+------+-----+---------+------- 4 rows in set (0.02 sec)
2007-05-11, 4585👍, 0💬
Popular Posts:
How To Download and install PSP Evaluation? - PSP Tutorials - Fading Images to Background Colors wit...
How did you implement UML in your project ? PART II Implementation phase / Coding phase (Class diagr...
Can you explain in brief how can we implement threading ? Private Sub Form1_Load(ByVal sender As Sys...
How can you raise custom errors from stored procedure ? The RAISERROR statement is used to produce a...
What are urlencode() and urldecode() functions in PHP? string urlencode(str) - Returns the URL encod...