search

Home  >  Q&A  >  body text

node.js - 求一个MYSQL查询语句

有四个表(比如是a、b、c、d),我要得到每个表中的'is_update'字段为0的id,能否用一次查询出来?

迷茫迷茫2779 days ago619

reply all(4)I'll reply

  • 黄舟

    黄舟2017-04-17 15:17:17

    How do you do a joint query when your four tables are not related?

    -》Recently I am doing a cross-table query of database tables divided by month. gem 'active_record_union' This will be suitable for you and help you encapsulate the union

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 15:17:17

    Of course, check the union keyword in SQL

    reply
    0
  • PHPz

    PHPz2017-04-17 15:17:17

    The correct solution above, union merges the result set

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:17:17

    If the amount of data is not large, you can refer to the union mentioned above. If the amount of data is large, it is recommended to query in pieces and then merge them in the program...

    reply
    0
  • Cancelreply