Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3404
  • Last Modified:

MS SQL ROW Number

In Oracle you can select row with clause <where rownumber = 2334>. How I can do the same in MS SQL? Do you know system veriables or function that return referenced ROW number?
0
aryaboy
Asked:
aryaboy
  • 3
  • 2
  • 2
  • +2
1 Solution
 
aryaboyAuthor Commented:
Edited text of question
0
 
Victor SpiridonovCommented:
There is no ROWID functino in MSSQL, however you can try using IDENTITY column property to emulate such behavior.
0
 
aryaboyAuthor Commented:
I cannot find the answer!
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Victor SpiridonovCommented:
Any comments ? Why do you reject correct answer?
0
 
gmoriakCommented:
This SQL will simulate returning row numbers

select (select count(*)
        from table_x t2
        where t2.pk_id <= t1.pk_id) row_number, t1.*
from table_x t1

For the pk_id column , use the primary key column of the table (you can modify to use more than one if necessary)

0
 
thresher_sharkCommented:
[from thresher_shark]

This question appears to have become corrupted.

aryaboy - You may wish to post a new copy of this question.
0
 
thresher_sharkCommented:
[from thresher_shark]

This question appears to have become corrupted.

aryaboy - You may wish to post a new copy of this question.
0
 
Victor SpiridonovCommented:
No comments.
0
 
wormzerCommented:
This question's now fixed.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now