RANK

Database

RANK

Hi,

I have a table like this:

ALTKN     DOCNUM                    KUNNR

000015  0000000058789756 198520

000015  0000000058843478 198520

000015  0000000058891716 198520

I will only get the row with the highest DOCNUM. SQL syntax to read only this rows?

000015  0000000058891716 198520

Regards

Mikael

2 REPLIES
Enthusiast

Re: RANK

SELECT ALTKN, DOCNUM, KUNNR

FROM TABLE_NAME

QUALIFY ROW_NUMBER() OVER(PARTITION BY ALTKN ORDER BY DOCNUM DESC) = 1;

Khurram

Re: RANK

Thanks a lot, it works.