比方说,我有3行具有相同的客户ID // dynamic
var a = 'test';
exports[a] = 1;
exports.test = 1;
// exports with module.exports
exports.a = 1;
module.exports = {
a: 2
};
。但是,我只想扣除不。仅来自第一行的约会Invoice_CustomerName
的日期。我在下面的查询将为具有相同客户ID的每一行扣除1个约会。
Invoice_TotalAppointment
我怎么只扣除第一行?
答案 0 :(得分:1)
设法解决了我的问题:)
UPDATE InvoiceNew SET Invoice_TotalAppointment = Invoice_TotalAppointment - 1
WHERE Invoice_ID = (SELECT MIN(Invoice_ID) FROM InvoiceNew
WHERE Invoice_CustomerName = @Appointment_ContactID
AND (IsDelete = 0 OR IsDelete = NULL)
AND (Invoice_TotalAppointment != 0))