解决方案 »

  1.   

    可以将B表设置成一个字段,作为外键,关联A表,B表形成多行记录,虽然记录增多了,但是可以做索引,效率高过字符串检索
      

  2.   

    10.4.4. The ENUM Type
    An ENUM is a string object with a value chosen from a list of allowed values that are enumerated explicitly in the column specification at table creation time. An enumeration value must be a quoted string literal; it may not be an expression, even one that evaluates to a string value. For example, you can create a table with an ENUM column like this: CREATE TABLE sizes (
        name ENUM('small', 'medium', 'large')
    );However, this version of the previous CREATE TABLE statement does not work: CREATE TABLE sizes (
        c1 ENUM('small', CONCAT('med','ium'), 'large')
    );You also may not employ a user variable as an enumeration value. This pair of statements do not work: SET @mysize = 'medium';CREATE TABLE sizes (
        name ENUM('small', @mysize, 'large')
    );If you wish to use a number as an enumeration value, you must enclose it in quotes. Duplicate values in the definition cause a warning, or an error if strict SQL mode is enabled. The value may also be the empty string ('') or NULL under certain circumstances: If you insert an invalid value into an ENUM (that is, a string not present in the list of allowed values), the empty string is inserted instead as a special error value. This string can be distinguished from a “normal” empty string by the fact that this string has the numerical value 0. More about this later. If strict SQL mode is enabled, attempts to insert invalid ENUM values
      

  3.   


    去看了ENUM 的介绍,感觉不适合我的需求.谢谢.