Hi folx
I want to use:
but this is not entirely correct as it causes the following problem:
The test data is the following:
The result with my SQL is:
I want the result to be:
Thank you.
I want to use:
Code:
SELECT NOCOLOUR, GRVQTY, MAX(CAST(GRVDOCNO AS INTEGER)) AS LATESTGRV INTO RESULT3 FROM RESULT2
GROUP BY NOCOLOUR
ORDER BY NOCOLOUR ASCENDING;
The test data is the following:
Code:
NOCOLOUR GRVQTY GRVDOCNO
A 10 1020
B 20 1012
B 50 1034
B 40 1065
Code:
NOCOLOUR GRVQTY LATESTGRV
A 10 1020
B 20 1065 <-- GRVQTY is nonsense
Code:
NOCOLOUR GRVQTY LATESTGRV
A 10 1020
B 40 1065 <-- the row must remain intact
Thank you.