请帮我从下面的查询中获取MAX AuditId(来自CheckDetailAddendumA表)值。
Select * from CheckDetailAddendumA
Where BusinessDate = '20041110'
and AuditID in (select AuditID from payments where paymentid in (select PaymentID from PaymentLinks where BusinessDate = '20041110' and ItemID = 11451163))
Order by AuditID
提前致谢!!!
答案 0 :(得分:0)
试试这个
Select * from CheckDetailAddendumA
Where BusinessDate = '20041110'
and AuditID = (select MAX(AuditID) from payments where paymentid in
(select PaymentID from PaymentLinks where BusinessDate = '20041110' and ItemID = 11451163))