本帖最后由 dancer3319 于 2012-07-31 17:49:59 编辑

解决方案 »

  1.   

    where find_in_set(12,'12,18,128,158')
      

  2.   

    mysql> select find_in_set(12,'12,18,128,158');
    +---------------------------------+
    | find_in_set(12,'12,18,128,158') |
    +---------------------------------+
    |                               1 |
    +---------------------------------+
    1 row in set (0.01 sec)
     
    mysql> select find_in_set(12,'128,18,12,158');
    +---------------------------------+
    | find_in_set(12,'128,18,12,158') |
    +---------------------------------+
    |                               3 |
    +---------------------------------+
    1 row in set (0.01 sec)
     
    mysql> select find_in_set(12,'128,18,13,158');
    +---------------------------------+
    | find_in_set(12,'128,18,13,158') |
    +---------------------------------+
    |                               0 |
    +---------------------------------+
    1 row in set (0.00 sec)if find_in_set (...) >0 then exist else not exist.