Learning Curve…

ROW_NUMBER() and OVER(ORDER BY …)

Posted on: December 20, 2010

Following statements Update ROW_NUMBER value as field value (SQL Server )..

WITH CTE AS
(
SELECT  *,  ROW_NUMBER() OVER(ORDER  BY VacancyId) AS rnk
FROM dbo.Vacancy
)
UPDATE CTE
SET JobTitle = JobTitle+ + CONVERT(VARCHAR(10),rnk)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Author

Learning days (Calendar)

December 2010
M T W T F S S
    Jan »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Knowledge Bank (Archives)

I am on Twitter

Blog Stats

  • 498,419 hits

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 43 other followers

%d bloggers like this: