Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8533

Re: How to generate a local id a data selection in SQLScript?

$
0
0

Hi,

 

I can think of one work around using window function ROW_NUMBER()

 

Please try the following:

 

select YR, ROW_NUMBER() over (partition by YR) as LOCAL_ID, MONTH_NAME, AMOUNT_SOLD from (

select YR, MONTH_NAME, sum(AMOUNT_SOLD) as AMOUNT_SOLD

from _SYS_BIC."efashion/EFASHION_STAR_SCHEMA"

where CITY='Austin'

and YR = 2001

GROUP BY YR, MONTH_NAME ) x;

 

Regards,

 

Ravi


Viewing all articles
Browse latest Browse all 8533

Trending Articles



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