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