dense_rank

1

Please login or register to vote for this query.

(click on this box to dismiss)

Audio-Video Production Meta

Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation

create table #temp
(
  journalSurrogateKey int,
  companyCode int,
  reportingLanguage varchar(20)
)

insert into #temp values (1, 1, 'DE')
insert into #temp values (2, 2, 'EN')
insert into #temp values (3, 2, 'EN')
insert into #temp values (4, 3, 'DE')
insert into #temp values (5, 3, 'EN')

SELECT journalSurrogateKey
     , dense_rank() OVER (
           ORDER BY companyCode
                  , reportingLanguage
       ) AS JEAdditionalAttributeSurrogateKey
     , companyCode
     , reportingLanguage
FROM #temp

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results