【问题标题】:How to use join query in SQL using X-devAPI and nodejs?如何使用 X-devAPI 和 nodejs 在 SQL 中使用连接查询?
【发布时间】:2019-04-08 10:20:31
【问题描述】:

我正在使用 NodeJ。用于编写查询的连接器 X-devAPI。我需要使用连接查询。如何编写查询?

const session = mySqlx.getSession(config);
 const schema = await session.getSchema('xxxx');
  let tableresp = await schema.getTable('tableName');
        tableresp = await tableresp
            .select(['id', 'name', 'Mobile'])
            .execute(function (row) {
               console.log(row)
            });

【问题讨论】:

    标签: sql node.js relational-database mysql-connector


    【解决方案1】:

    目前您必须使用普通 SQL 查询。

    await session.sql('SELECT id, name, Mobile FROM xxxx.tableName JOIN ...').execute()
    

    抱歉回复晚了。你的问题没有出现在我正在观看的标签中。

    免责声明:我是 MySQL X DevAPI Connector for Node.js 的首席开发人员

    【讨论】:

      猜你喜欢
      • 2017-03-04
      • 2017-12-19
      • 2021-11-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-01
      相关资源
      最近更新 更多