Wells-it.com - Web Hosting

MySQL - the SET column type

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

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