Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: SAP HANA QUERY

$
0
0

Hello Justice,

 

sorry for my previous answer (seems that I had some drumming apes in my head :-)). Now I understand your requirement.

 

My question is, why do not need the intermediate result table at all? You can get the result w/o the additional table.

 

E.g. in an easy way:

SELECT * FROM (

SELECT ROW_NUMBER() OVER (PARTITION BY VPM2."InvoiceId",OVPM."DocNum"

ORDER BY OVPM."CardName") AS "T", VPM6."TaxbleAmnt", VPM6."WTSum", OVPM."CardCode",

OVPM."CardName", OVPM."DocNum", OVPM."DocDate", VPM6."TxblAmntFC", VPM6."WTSumFC",

OPCH."NumAtCard", OVPM."Comments", OVPM."DocTotal", OVPM."DocTotalFC", VPM2."InvoiceId"

FROM OVPM INNER JOIN VPM2 ON VPM2."DocNum" = OVPM."DocEntry"

INNER JOIN VPM6 ON VPM6."DocNum" = OVPM."DocEntry"

INNER JOIN OCRD ON OCRD."CardCode" = OVPM."CardCode"

INNER JOIN OPCH ON OPCH."CardCode" = OCRD."CardCode"

  WHERE OVPM."Canceled" <> 'y'

)

WHERE "T" = 1

        AND "DocNum"='1004179';

 

Please check also if you can already restrict the inner select statement to the specific document number (it seems so to me).

 

Regards,

Florian


Viewing all articles
Browse latest Browse all 9165

Trending Articles



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