您应该为此使用带有外键的表:
YourTable
col1 ...
col2 ...
YourTypeCol char(1) FK to YourTypeTable
col4 ...
YourTypeTable
YourTypeCol char(1) PK <<make the data type fix your "set"
YourTypeColDescription string
例如,你会得到如下数据:
CarTable
CarID int PK auto number
CarMaker int FK
CarBuilt date
....
CarID CarMaker CarBuilt
1 1 1/10/2005
2 4 3/18/2004
3 3 10/31/2009
...
CarMakerTable
CarMake int PK
CarMakeName string
CarMake CarMakeName
1 Ford
2 GM
3 Honda
4 Mazda
...
So that a field of that type can contain one or more values from that data type
我不建议这样做。最好的做法是每个“字段”只存储一个值。在一个字段中存储多个值违反了
Database normalization