Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

urgent !!!! need the right sql method to add new column into exist table

 
yossi avisror
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i would like to get the right sql method to add new column into exist table
(i am using mysql server).
 
Daniel Dunleavy
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know mysql..but in oracle...alter table add colname char
 
yossi avisror
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thankes Daniel you realy helped me

 
David DeCesare
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One additional feature that MySQL has is the ability to add a new column next to an existing column (rather than being slapped at the end):
ALTER TABLE tableName ADD newColumnName VARCHAR(32) NOT NULL AFTER existingColumnName
Hope that helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic