Results 1 to 1 of 1
Jul 7, 2002, 13:28 #1
- Join Date
- Apr 2002
- 0 Post(s)
- 0 Thread(s)
How to alter SET and ENUM columns: special syntax?
I have problems figuring out how to alter SET and ENUM types in mySQL.
It's a snap in phpMyAdmin, but if I build a CMS for a client, I won't let him use that ;-).
Funny thing is, although most commands are echo'd in phpMyAdmin, altering SET and ENUM columns do not return anything.
these SELECT statements all work perfectly:
select * where cat.name = 'foo':
SELECT * FROM table WHERE (Kat='foo');
select * where cat.name NOT 'foo':
SELECT * FROM table WHERE FIND_IN_SET('foo',Kat)<1;
select * where cat.name neither 'foo' nor 'bar':
SELECT * FROM table WHERE (FIND_IN_SET('Konsum',Kat)<1) AND (FIND_IN_SET('POS',Kat)<1)
OK, but what about *altering* the SET's? Removing a SET item, adding one, or renaming?
On the mySQL manual page there's this syntax posted in the user-contributions:
UPDATE table SET myCol = concat(myCol, ',additional item')
for adding one SET item, but that doesn't work.
I tried different commands, with ALTER TABLE, UPDATE, and what not, but none is working.
It's a shame there is so little mention of altering ENUM and SET columns in the official manual, considering how useful these datatypes are (or rather - could be).
Oh, and on a similar subject:
Does anyone know what the MAJOR difference is between SET and ENUM (preferrably from a real-life scenario point of view)? SET can have only 64 members, whereas ENUM can have 65535 elements. So why would I limit myself to only 64 entries with a SET?
Any and every sample syntax, link, and help is highly appreciated.