If you are asking how to number the records in your table with a simple SQL
statement, I don't think that's going to be an easy thing to do. If your
back-end is an ORACLE database you're in luck, b/c ORACLE creates a RowNum
pseudocolumn during query processing that you can select. e.g.:
SELECT RowNum, CustName
FROM Customer
ORDER BY CustName
but I know Access doesn't do this. I don't know of SQL Server does anything
like it. If you can't take advantage of this your options are to add a
column to the table to store a record number (in which case you may have to
worry about breaks in the sequence caused by deletes), or create a new table
with an Autonumber field that you then SELECT INTO from your real table.
HTH,
-Roy
Roy Pardee
Programmer/Analyst
SWFPAC Lockheed Martin IT
(xxx) xxx-xxxx
-----Original Message-----
From: srikieat [mailto:srikieat@y...]
Sent: Saturday, October 20, 2001 7:47 AM
To: professional vb
Subject: [pro_vb] sql statment
Dear all,
I have to know some sql Script. I want to get the record set that display no
of
recorcd in sequent. For examply, I use select statement to get the record
set in
customer table to display customer name. It retures 10 records for example.
I
want it to show 2 columes , one is Customer name and another is record
number. I mean I want the record to show as below
No Customer name
1 Customer name1
2 Customer name 2
3 Customer name 3
.
.
.
Note : colume no is not customer id.
How to write such sql statement?
Thanks in advance