Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8581

Re: HANA SQL Sub Query - Unique Record

$
0
0

Not sure if your requirements are actually fulfilled by the following, but it should at least generate your samples:

 

SELECT ap."Sales Order", ap."Item", ep."Schedule Line", ep."Delivery Date", ep."Confirmed Qty"

FROM "VBAP" ap

     INNER JOIN

          (SELECT TOP 1 "Sales Order", "Item", "Schedule Line", "Delivery Date", "Confirmed Qty"

           FROM "VBEP"

           ORDER BY "Confirmed Qty" DESC) ep

     ON ap."Sales Order" = ep."Sales Order";



Looking at the sample result sets it looks as if it would be possible to select the data only based on "VBEP", but I assumed that there are some more selection criteria that you want to apply based on "VBAP".

Also, and don't take this the wrong way, but it is really a SQL beginner's question. So if you are going to develop more SQL it might be a good choice to top up your game and learn more about SQL programming.

 

- Lars



Viewing all articles
Browse latest Browse all 8581


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