Jika Anda baru mengenal dunia async, Anda harus melihat modul 'async'.
Anda kemudian dapat melakukan sesuatu seperti ini :
async.forEachOfSeries(ids, function(id,index,callback){
var q = "UPDATE mytable SET sequence="+index+" where id="+id+"; ";
this.connection.query(q, function(err, result) {
callback();
});
},function done(){
// whatever you want to do onces all the individual updates have been executed.
})