View previous topic :: View next topic |
Author |
Message |
Alderaan
Joined: 29 Jan 2005 Posts: 3
|
Posted: Sun Mar 13, 2005 14:21 Post subject: Adding columns with SQL |
|
|
I have a table called "Table", I want SQL to add a column "C1" (INT(11)) if "Table" does not contains already "C1". IF "Table" already contains "C1", then do nothing.
How can I do that under SQL?
Thanks |
|
Back to top |
|
|
NoMercy
Joined: 03 Jan 2005 Posts: 123 Location: UK
|
Posted: Sun Mar 13, 2005 15:12 Post subject: |
|
|
ALTER TABLE 'Table' ADD C1 INT(11);
I can't think of any nice way of testing if the column exists, but if it does this statement will in theory just generate an error. |
|
Back to top |
|
|
|