serial number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
I would like to know how to add a serial number to a query.
something like that:
serial id name
1
2
3
 
Why? What would this accomplish? Do you plan to store that number?

It seems your "ID" field would be the unique record number that you desire.

If you wish to include a line number for your queries. do a search and read
the previous posts. This question is asked and answered pretty often, but
you might use "line number" when you search or "consecutive numbers". You
would most often see this request in reports, not queries.

Post back if you can't find what you are looking for.
 
Here's an example, which sorts and numbers the records on the basis of
the values in the ID field.

SELECT
(SELECT COUNT(1)
FROM MyTable AS B
WHERE B.ID <= A.ID
) AS SEQ,
ID, FirstName, LastName
FROM MyTable AS A
ORDER BY ID
;
 
Back
Top