SQLTeam.com | Weblogs | Forums

Sequential Number


#1

Hello -

I'm not that new to SQL, I just don't get to use it often!

I have a list of Member Identification Numbers that I would like to mask. The numbers are mixed text and numeral like 'NHP0001107', 'NHP0001108', 'NHP0001109', etc. I would like to add a new column that replaces the numbers with Claimant #1, Claimant #2, Claimant #3, etc.

I can't figure out how to do this though, can anyone please help me?

John


#2

SELECT c1, 'Claimant #' + CAST(ROW_NUMBER() OVER(ORDER BY c1) AS varchar(100)) AS NewColumn
FROM @t