MySQL - the SET column type

They have: 46 posts

Joined: May 2002

Can I add members to a SET column type? (SET is like ENUM, but can be multiple members instead of just one of the members)

Example:

CREATE TABLE pizza (
topping SET ("pepperoni", "onions") NULL)
-->and of course lots of other columns would be defined here...

INSERT INTO pizza VALUES ("pepperoni"), ("pepperoni,onions")

Can I go back into this table and add new members to the _topping_ column? Without messing up the data stored in the table?

What would be the SQL command to do this?

druagord's picture

He has: 335 posts

Joined: May 2003

this should help

ALTER TABLE pizza MODIFY COLUMN topping SET ("pepperoni","onions","cheese") NULL
'

you can visit the following link to get the full mysql manual http://www.mysql.com/doc/en/index.html

IF , ELSE , WHILE isn't that what life is all about

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.