technical skills grow

Responsive Ads Here

Thursday, August 5, 2021

GET DENSE RANK WITHOUT RANK FUNCATION

set @rownum1:=0;
select AREA_ID ,
@rownum1:=(CASE WHEN (AREA_ID=@Tmax_18) THEN @rownum1+1 ELSE 1 END ) AS num1,(@Tmax_18:=AREA_ID) RANGE_SET
from 30Days_Forecast_File
where AREA_ID in (1,2)

 # AREA_ID, num1, RANGE_SET
'1', '1', '1'
'1', '2', '1'
'1', '3', '1'
'1', '4', '1'
'1', '5', '1'
'1', '6', '1'
'1', '7', '1'
'1', '8', '1'
'1', '9', '1'
'1', '10', '1'
'1', '11', '1'
'1', '12', '1'
'1', '13', '1'
'1', '14', '1'
'1', '15', '1'
'1', '16', '1'
'1', '17', '1'

No comments:

Post a Comment

Powered by Blogger.

Labels

Contact Form

Name

Email *

Message *

Search This Blog

Blog Archive

Ad Code

Responsive Advertisement

Recent Posts