cancel
Showing results for 
Search instead for 
Did you mean: 

Group on measures not working

Former Member
0 Kudos

Hi, I want to find out the most common values for field "x", and "x" is a measure with DECIMAL type. So I ran the 1st sql, The output has only 1 record with some random value for "x". I know "x" has many different values. If "x" is NVARCHAR, it works well. But when "x" is DECIMAL, it doesn't work. I have to run the 2nd sql in order to get the results. But I'm concerned about performance issues of the 2nd sql, does it use too much computing resources? Can someone help? Thanks.

SELECT "x", count(*) as cnt

FROM "table1"

GROUP BY "x"

ORDER BY cnt DESC

SELECT "x", count(*) as cnt

FROM (SELECT "x" FROM "table1")

GROUP BY "x"

ORDER BY cnt DESC

Accepted Solutions (0)

Answers (1)

Answers (1)

pfefferf
Active Contributor
0 Kudos

Hi,

I'm wondering how you can get different result for both statements, because in fact internally they are executed the same way as the explain plan shows.

On my environment (SPS10) system both statements delivers the correct result.

On which SPS level you are? Can you share the statements with results and the explain plan?

Regards,

Florian

Former Member
0 Kudos

I use SAS and ODBC connection to pass through the SQL script to HANA.

pfefferf
Active Contributor
0 Kudos

Then I would recommend to trace your statements to check how the statement written in SAS is actually executed on HANA. In the form like described above there is no issue on HANA side.