mysql syntax

Dick7Access

Dick S
Local time
Today, 14:48
Joined
Jun 9, 2009
Messages
4,291
Just very very new beginner, I have three MySQL books a on line course and hours many hours of goggling and I can't find a simple syntax for adding a new column in an existing table. Here is the example that I get from goggling, but no matter what variations I try the syntax is wrong. Can someone give me the exact syntax from this example?

Code:
ALTER TABLE table_name
  ADD new_column_name column_definition
    [ FIRST | AFTER column_name ];

please use tblMain for the table name and INDP for the new column
Thanks
 

Thanks, I was able to get it to work from the example on the link you sent me. On the first two tries I still received wrong syntax. I then notice that the example in the link was using int as a data type, and I was using varchar as that is what I used when I built my test db. Once I switch to int it worked ok. I will have to study to see why varchar didn't work. Thanks again!
 

Users who are viewing this thread

Back
Top Bottom