Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 2129

Select Distinct/MAX

$
0
0

Hello,

 

I have the following entries in MARC (example)

 

MaterialPlantProfit Center
123456US500000
123456MX500000
123456TJ600000
123456AU500000
123456FR500000
7890US600000
7890MX600000
7890AU500000
7890FR600000

 

I would like to do something like the following:

 

SELECT DISTINCT on material number with the MAXIMUM number of profit centers

 

So I would end up with the following entries in my internal table:

 

123456  500000

7890     600000

 

Unfortunately, I cannot restrict based on plant because there isn't one plant that all Materials exist in.

I understand I can select all records and delete duplicates but this does not guarantee that I will get the profit center which appears the most.

 

Thank you!


Viewing all articles
Browse latest Browse all 2129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>