SELECT jid, tid, NAME, sales, province
    , city, provider, jdaddress, qpaddress, area_flag
    , price, LEVEL, open_time, contact, sort
    , shelves, cover_pic, pics, create_date, push_hpage
    , last_date
FROM m
WHERE shelves = 1
    AND (INSTR(tid, ',1,') > 0 OR tid LIKE '1,%')
LIMIT 0,4;

解决方案 »

  1.   

        AND (INSTR(tid, ',1,') > 0 OR tid LIKE '1,%')
      

  2.   

    支持使用 find_in_set   用法如下,希望对你有帮助 
      

  3.   


    SELECT FIND_IN_SET("261,",'1,');
    学习了一招技巧,。mysql> SELECT FIND_IN_SET("261,",'1,');
    +--------------------------+
    | FIND_IN_SET("261,",'1,') |
    +--------------------------+
    |                        0 |
    +--------------------------+
    1 row in set (0.00 sec)mysql> 
      

  4.   

    select * from m where  
    find_in_set('2',tid)
    -- 2是要查询的字符
    -- tid 是要查询的列.谢谢楼上各位,可以用的。谢谢。