Solved

MS SQL ROW Number

Posted on 1999-01-14
9
3,369 Views
Last Modified: 2010-05-18
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
Comment
Question by:aryaboy
  • 3
  • 2
  • 2
  • +2
9 Comments
 

Author Comment

by:aryaboy
ID: 1092662
Edited text of question
0
 
LVL 7

Expert Comment

by:spiridonov
ID: 1092663
There is no ROWID functino in MSSQL, however you can try using IDENTITY column property to emulate such behavior.
0
 

Author Comment

by:aryaboy
ID: 1092664
I cannot find the answer!
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 7

Expert Comment

by:spiridonov
ID: 1092665
Any comments ? Why do you reject correct answer?
0
 
LVL 3

Accepted Solution

by:
gmoriak earned 200 total points
ID: 1092666
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
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1092667
[from thresher_shark]

This question appears to have become corrupted.

aryaboy - You may wish to post a new copy of this question.
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1092668
[from thresher_shark]

This question appears to have become corrupted.

aryaboy - You may wish to post a new copy of this question.
0
 
LVL 7

Expert Comment

by:spiridonov
ID: 1092669
No comments.
0
 
LVL 1

Expert Comment

by:wormzer
ID: 1092670
This question's now fixed.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question