Skip to Content
avatar image
Former Member

How could I use a window function median() in a sql console

Hi, everyone

I got an error message" feature not supported: not supported window function:" when I try to run a sql script in SPS08.

SELECT

  MEDIAN(DURA) OVER(PARTITION BY TIME2) as MedianValue,

    TIME2

FROM

(

SELECT

  TO_INT((HOUR(TIME_2)*60+MINUTE(TIME_2))/5) AS TIME2,

  DURA

FROM

  TRAFFIC.D26PAIRSCER

);

HANA gave me an error:  :

Could not execute 'SELECT MEDIAN(DURA) OVER(PARTITION BY TIME2) as MedianValue, TIME2 FROM ( SELECT ...' in 11 ms 603 µs .

SAP DBTech JDBC: [7] (at 8): feature not supported: not supported window function: line 2 col 2 (at pos 8)

according to the windows function page, it looks right.

Thanks a lot!

SQL
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 19, 2015 at 01:30 PM

    The MEDIAN aggregation is available as of SAP HANA SPS9.

    - Lars

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 14, 2015 at 11:10 AM

    Hello Shu,

    if I understand correctly and the problem happens during HANA SQL development, this question might be sooner answered on the Space http://scn.sap.com/community/hana-in-memory, as that Space handles HANA-related questions.

    Perhaps you want to post this question there too.

    Best regards,
    Laszlo

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Dear Laszlo Badovszky,

      Yes, it happens when I am in the SQL command window:).

      Thanks a lot.

      Best regards,

      Laszlo