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

Re: ORDER BY in CE Functions

$
0
0

Hi CV,

 

Even I was amazed that this functionality is not provided in the CE_PROJECTION() function directly, however I found that this can be achieved using Arrays for single columns, you can find documentation for arrays in section 7.7 of SQL Script Reference guide available at help.sap.com/hana_platform.

 

For your specific example the code would look like(assuming A is Primary Key)

 

:tab = CE_COLUMN_TABLE("TABLE1");
:tabproj = CE_PROJECTION (:tab,["A","B"], '"D" = some value');
:sort = ARRAY_AGG(:tabproj.A ORDER BY A ASC);
:sorttab = UNNEST(:sort) AS "A";
:result = CE_JOIN(:sorttab,:tabproj, ["A"]);

 

As I have not tried this on the system, I am not sure that this would be giving expected result. Can you try this and let us know if it works.

 

--

Shreepad


Viewing all articles
Browse latest Browse all 9165

Trending Articles



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