【问题标题】:SELECT @variable do not work in mysql?SELECT @variable 在 mysql 中不起作用?
【发布时间】:2013-09-10 12:18:15
【问题描述】:
var client = new require("mysql-pool").MySQLPool({...});

client.query( 
   "SET @counter := 0, @type := 'asd'; select @counter, @type"   ,

    function (error, result, fields) {
       if (error) {
           throw error;
       }else{
          cb(result, fields);
       }
    });

( 

查询在工作台或 dbForge 中工作得很好,mysql-pool 也可以工作,但只有没有 @variable_name )

【问题讨论】:

    标签: mysql node.js node-mysql


    【解决方案1】:

    也许是这样?

    "SELECT @counter := 0, @type := 'asd'"
    

    但是 TYPE 可能是 RESERVED 名称,所以考虑使用 sth。否则即。 ENTITY_TYPE

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-29
      • 1970-01-01
      • 2016-02-26
      相关资源
      最近更新 更多