Node.js sqlite3 IN operator

后端 未结 2 810
野的像风
野的像风 2021-02-14 07:25

So I am currently trying to make a query in Node.js:

// friends is an array object
db.all(\'SELECT email \' +
       \'FROM users\' +
       \'WHERE email in ?\'         


        
2条回答
  •  梦如初夏
    2021-02-14 08:03

    db.all('SELECT email ' +
           'FROM users' +
           'WHERE email in ( ' + friends.map(function(){ return '?' }).join(',') + ' )', 
           friends, 
           function(err, rows) {
               if (!err) {
    

提交回复
热议问题