Created
July 18, 2016 19:13
-
-
Save uyu423/bfa5a2867d0c90b1a441d3f5543239a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var qsb = require("node-qsb") | |
var qs = new qsb().select('myTable', 'MT') | |
.join('yourTable', 'YT') | |
.join('ourTable', 'OT') | |
.where('MT.idx', '=', 'YT.mIdx') | |
.where('YT.idx', '=', 'OT.yIdx') | |
.where('MT.idx', '<=', 10) | |
.whereOr('YT.idx', '<', 100) | |
.limit(0, 100) | |
.orderBy('MT.a', 'desc') | |
.build(); | |
console.log(qs.returnString()); | |
//SELECT * FROM `myTable` `MT` JOIN `yourTable` `YT` JOIN `ourTable` `OT` WHERE `MT`.`idx` = 'YT.mIdx' AND `YT`.`idx` = 'OT.yIdx' AND `MT`.`idx` <= '10' OR `YT`.`idx` < '100' ORDER BY `MT`.`a` desc LIMIT 0, 100; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment