search

Home  >  Q&A  >  body text

node.js - nodejs sequelize 如何mysql多表查询

使用nodejs sequelize进行mysql的数据库查询,只会只用它查询一张表,如果想要同时查询两张表达到如下效果

MYSQLSELECT * FROM A,B WHERE A.name = B.name;
ringa_leeringa_lee2786 days ago651

reply all(2)I'll reply

  • 阿神

    阿神2017-04-17 11:59:10

    Refer to this
    http://www.it165.net/pro/html/201508/50341.html

    reply
    0
  • 阿神

    阿神2017-04-17 11:59:10

    The latest official version v3.13.0

    Define table association, see: http://docs.sequelizejs.com/en/latest/docs/associations/
    AssociationQuery, see: http: //docs.sequelizejs.com/en/latest/docs/querying/#relations-associations

    Historical version documentation
    v2.0 http://docs.sequelizejs.com/en/2.0/
    v1.7 http://docs.sequelizejs.com/en/1.7.0/

    reply
    0
  • Cancelreply