Updating multiple rows with node-mysql, NodeJS and Q

前端 未结 5 857
-上瘾入骨i
-上瘾入骨i 2020-12-16 22:44

I am using node-mysql, node-js, and Q promises.

I have successfully updated, deleted, and inserted single rows using the above. As well as inserted multiple rows in

5条回答
  •  北海茫月
    2020-12-16 23:18

    You should probably do following way

    UPDATE DB.table
    SET table.row = newValue WHERE table.someColumn in ('columnVal1', 'columnVal2');
    

    ex.

    UPDATE DB.Students
    SET result = "pass" WHERE rollNo in (21, 34, 50);
    

提交回复
热议问题