推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
bmcjxhgwy
V2EX  ›  Python

请教一下 mysql 中如何定义一个为列表的常量啊?

  •  
  •   bmcjxhgwy · Nov 11, 2019 · 4722 views
    This topic created in 2515 days ago, the information mentioned may be changed or developed.
    例子:SET @a= ('vehicle','traffic');
    select count(*) from 表 WHERE 字段 in @a

    这样子写报错了,如何定义一个列表结构的常量呢?
    3 replies  •  2019-11-11 16:36:14 +08:00
    kiracyan
        1
    kiracyan  
       Nov 11, 2019
    select 1
    union
    select 2
    binjjam
        2
    binjjam  
       Nov 11, 2019   ❤️ 1
    set @a='vehicle,traffic';
    select count(*) from 表 WHERE FIND_IN_SET(字段,@a);
    bmcjxhgwy
        3
    bmcjxhgwy  
    OP
       Nov 11, 2019
    非常感谢,已解决
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2395 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 05:10 · PVG 13:10 · LAX 22:10 · JFK 01:10
    ♥ Do have faith in what you're doing.