V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
bmcjxhgwy
V2EX  ›  MySQL

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

  •  
  •   bmcjxhgwy · Nov 11, 2019 · 4884 views
    This topic created in 2359 days ago, the information mentioned may be changed or developed.
    SET @motor_vehicle = ('vehicle','traffic');
    select count(*) from '表' WHERE ‘字段’ in @motor_vehicle 
    

    这样子写报错了,如何定义一个列表结构的常量呢?

    2 replies    2019-11-13 09:40:17 +08:00
    fuxkcsdn
        1
    fuxkcsdn  
       Nov 13, 2019 via iPhone
    用字符串拼接( concat )
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2918 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 15:30 · PVG 23:30 · LAX 08:30 · JFK 11:30
    ♥ Do have faith in what you're doing.