开发者

define 'enum' and 'set' columns in mysql with same values

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 'enu开发者_如何转开发m' 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...


You could rather do something like:

CREATE TABLE foo(bar VARCHAR(10),
                 CHECK(bar IN ('value1', 'value2'))
                );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜