我正在编写一个如下所示的存储过程:
SELECT Replace(c_invoice, Char(13) + Char(10), ''),
c_uom1,
c_uom2
FROM @invoice_TABLE AS invoice
INNER JOIN @uom1_TABLE AS uom1
ON invoice.ID = uom1.ID
INNER JOIN @uom2_TABLE AS uom2
ON uom1.ID = uom2.ID
WHERE uom1.ID = 4
但我希望 WHERE 子句使用最高的 uom1.ID 号码 - 有人可以告诉我如何做到这一点吗?