SELECT
ij.IJITEM AS Part,
ij.IJLOC AS Location,
ib.IFQOH AS QOH,
MAX(ij.IJDATE) AS Inv_Date
FROM
dbo.S2K_IJALL ij
LEFT OUTER JOIN dbo.S2K_IB ib
ON ib.IFITEM = ij.IJITEM AND ib.IFLOC = ij.IJLOC
WHERE
IJITEM LIKE '%-IC'
AND
IJRBAL < 0
GROUP BY
ij.IJITEM,
ij.IJLOC,
ib.IFQOH
我需要在上面的查询中添加一个字段。当我这样做时,MAX 日期字段不会保持。我得到添加的字段具有值的每条记录。我怎样才能拉回 MAX 日期该字段的值?