-1

I have the following data:

ITEM         LOC    NAME                PROMO_ID
100281362   12004   MOB-ACC-FEB7-DEC31  56008
100281362   12004   SPO_CLR-MAY25-JUN4  58414
100281362   12004   MOB-ACC-FEB7-DEC31  56023

I want the result to be:

based on the highest PROMO_ID value For every item/loc/name combination, it should only fetch one row with the highest promo_id

MT0
  • 143,790
  • 11
  • 59
  • 117
Imran Hemani
  • 599
  • 3
  • 12
  • 27

1 Answers1

0

Do you mean this?

select ITEM, LOC, NAME, max(PROMO_ID) as PROMO_ID
from your_table
group by ITEM, LOC, NAME
James
  • 2,954
  • 2
  • 12
  • 25