SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Row_number()
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

wided
Posting Yak Master

201 Posts

Posted - 04/17/2014 :  04:17:26  Show Profile  Reply with Quote
Hello

I need to have a sequential record number :

select RecordNumber, col1, col2 from table1 ...

What should write as RecordNumber (Row_number())

I need to have this result

Num col1 col2
1 v1 v11
2 v2 v22
3 v3 v23
4 v4 v23

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 04/17/2014 :  05:00:19  Show Profile  Reply with Quote
row_number() over (order by col1, col2) as RecordNumber



KH
Time is always against us

Go to Top of Page

wided
Posting Yak Master

201 Posts

Posted - 04/17/2014 :  05:46:02  Show Profile  Reply with Quote
thanks
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000