473,484 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Row numbers

jamesd0142
469 Contributor
I have a basic query such as...

Expand|Select|Wrap|Line Numbers
  1. SELECT WBLTP_Payment
  2. FROM DS_WBLTP_Payment
  3.  
this shows data like..

<colunmname>
12
13
14
15

QUESTION:
How can i get row numbers also so my result looks like this...

<ID><colunmname>
1 12
2 13
3 14
4 15
Dec 6 '07 #1
5 1459
ck9663
2,878 Recognized Expert Specialist
i don't think there's a record/row number that's automatically created in sql server. if you really need to, read this:


http://www.sqlteam.com/article/retur...ber-in-a-query


-- CK
Dec 6 '07 #2
Jim Doherty
897 Recognized Expert Contributor
I have a basic query such as...

Expand|Select|Wrap|Line Numbers
  1. SELECT WBLTP_Payment
  2. FROM DS_WBLTP_Payment
  3.  
this shows data like..

<colunmname>
12
13
14
15

QUESTION:
How can i get row numbers also so my result looks like this...

<ID><colunmname>
1 12
2 13
3 14
4 15
What version SQL Server are you using?

Jim
Dec 9 '07 #3
jamesd0142
469 Contributor
im using SQL server 2000
Dec 10 '07 #4
Jim Doherty
897 Recognized Expert Contributor
im using SQL server 2000
OK just wondered because SQL Server 2005 took this on board with 'row_number over' it doesnt exist in 2000 so go with ck9663s post

Jim :)
Dec 10 '07 #5
jamesd0142
469 Contributor
Yes, id appriciate some help if possible, tried for hours on this and still no good.

Thanks

for example:

table contains several columns

table: users

column names: fName, lName, Login, password
Dec 11 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
10715
by: August1 | last post by:
A handful of articles have been posted requesting information on how to use these functions in addition to the time() function as the seed to generate unique groups (sets) of numbers - each group...
16
2413
by: StenKoll | last post by:
Help needed in order to create a register of stocks in a company. In accordance with local laws I need to give each individual share a number. I have accomplished this by establishing three tables...
12
5194
by: Jim Michaels | last post by:
I need to generate 2 random numbers in rapid sequence from either PHP or mysql. I have not been able to do either. I get the same number back several times from PHP's mt_rand() and from mysql's...
7
3983
by: Gerard Flanagan | last post by:
All would anyone happen to have code to generate Cutter Numbers: eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm or is anyone looking for something to do?-) (I'm under...
10
3266
by: LuTHieR | last post by:
Hi, I'm reading a string of numbers from a file (using Borland C++ Builder 6), and I'm doing it like this: first I use FileRead to store all the data in the file to a char* variable (appropriately...
7
4874
by: newstips6706 | last post by:
1, 2, 3, 5, 7... PRIME Numbers ________________________________ Definitions What is a PRIME Number ?
17
4593
by: Ron | last post by:
I want to write a program that will accept a number in a textbox for example 23578 and then in a label will display the sum of the odd and even number like this... the textbox containsthe number...
13
2766
by: Peter Oliphant | last post by:
I would like to be able to create a random number generator that produces evenly distributed random numbers up to given number. For example, I would like to pick a random number less than 100000,...
24
7172
by: pereges | last post by:
I need to generate two uniform random numbers between 0 and 1 in C ? How to do it ? I looked into rand function where you need to #define RAND_MAX as 1 but will this rand function give me ...
0
7082
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7105
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7144
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7214
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4845
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3046
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1359
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
592
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.