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

Re: Rows count mismatch between sap HANA and Sql after execution of select statement

$
0
0

Hi Naresh,

 

I had similar issues and found that it was because of the difference in case sensitivity. SQL server is not case sensitive but HANA is. Try  below query in HANA and see if it matches with SQL server output.

 

SELECT M."REGION", SA."GroupName", SA."Yr", SA."Qtr", SA."Mth", SA."Lvl", SA."MetricValue2", SS."MetricValue"

        FROM "JIVE"."TBL_MKT_SNUG_SIG_METRICS_ACTIVE" SA

        LEFT OUTER JOIN "JIVE"."TBL_MKT_SNUG_SIG_METRICS" SS

        ON UPPER(SS."GroupName") = UPPER(SA."GroupName")

        AND UPPER(SS."Yr") = UPPER(SA."Yr")

        AND UPPER(SS."Qtr") = UPPER(SA."Qtr")

        AND UPPER(SS."Mth") = UPPER(SA."Mth")

        AND UPPER(SS."Lvl") = UPPER(SA."Lvl")

        INNER JOIN "JIVE"."TBL_MKT_SNUG_SIG_MAP" M ON UPPER(SS."GroupName") = UPPER(M.SNUG_SIG_GROUP) AND UPPER(M."REGION") <> 'SIG'

 

Basically, I have used UPPER() function in all the join conditions assuming that all of them are of character type. If you have any numeric field on which join is done then you don't need the UPPER() function.

 

Regards,

Amit


Viewing all articles
Browse latest Browse all 9165

Trending Articles



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