const con = require('./connect'); function maxWagon(collectionFk, callback) { let sql = `SELECT MAX(tc.wagon) AS MaxWagons FROM ticketCollection tc WHERE tc.collectionFk = ${collectionFk}`; con.query(sql, function(err, result, fields) { callback(null, result); }); } exports.maxWagon = maxWagon;