简体   繁体   中英

Is there a way to group rankings in SQL Teradata?

I am trying to get the ranking or grouping to count like in the custom_ranking column:

在此处输入图片说明

I want it to count the rank like in the row custom_ranking, but everything I keep trying is counting it in the current_ranking row.

I am currently using this:

,row_number() OVER (partition by custID, propID  ORDER BY trans_type desc, record_date desc) AS RANKING

根据您的样本数据,这将是:

dense_rank() over (partition by custid order by propid)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM