Hello!

Nitesh Divecha wrote:

>Hello All,
>
>I need help with tables. I have created my table with some attributes in
>it. 
>
>I need to modify my table attributes, can any one help me with the
>modify command or can give me the short cut to the web.
>
>Example:
>Mysql> create table test(ID int(4), Name varchar(20), Sex varchar(1));
>
>Now I need to change the attribute NAME TO Full name, HOW?
>
>Please help, Thanking in Advance.
>  
>

As far as I understood the ALTER TABLE syntax, this cannot be done that 
easily, try:

ALTER TABLE test ADD COLUMN Full_name int AFTER ID;
UPDATE test SET Full_name = Name;
ALTER TABLE test DROP COLUMN Name;

Greetings
 Ralf

sql query

-- 
Ralf Narozny
SPLENDID Internet GmbH & Co KG
Skandinaviendamm 212, 24109 Kiel, Germany
fon: +49 431 660 97 0, fax: +49 431 660 97 20
mailto:[EMAIL PROTECTED], http://www.splendid.de




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to