views:

17

answers:

1

is there a way to define an column of type 'enum' and then define another column in the same table of type 'set' with the same values of the 'enum' ?

for example we have an 'enum' with values "one", "two", "three", we define the first column in the table with that enum type. Then I need to define the second column in the table with the 'SET' of "one", "two" and "three".

I hope I made myself clear on that...

+1  A: 

You could rather do something like:

CREATE TABLE foo(bar VARCHAR(10),
                 CHECK(bar IN ('value1', 'value2'))
                );
Benoit
i'm not sure this is the right way, i was thinking more of predefining the values somehow and then use them for enum and set, but thanks for the hint ... +1
0xAF