Sep 29, 2005 #1 Recce Programmer Aug 28, 2002 425 ZA Good day, I have a table in Access and would like to number the rows in a column. Can anyone suggest any way of doing this ? "We know nothing but, that what we know is not the truth..." - Me
Good day, I have a table in Access and would like to number the rows in a column. Can anyone suggest any way of doing this ? "We know nothing but, that what we know is not the truth..." - Me
Sep 29, 2005 1 #2 HarleyQuinn Programmer Jan 15, 2003 4,769 GB One way would be to add a field with the datatype of AutoNumber. Hope this helps HarleyQuinn --------------------------------- Help us to help you, read FAQ222-2244 before posting. Upvote 0 Downvote
One way would be to add a field with the datatype of AutoNumber. Hope this helps HarleyQuinn --------------------------------- Help us to help you, read FAQ222-2244 before posting.
Sep 29, 2005 2 #3 cmmrfrds Programmer Feb 13, 2000 4,690 US Assuming the table has a unique id, then row number can be generated for the duration of the query by a self join. Select count(*) as rownum,B.id From WoTable A inner join WoTable B On A.id <> B.id where A.id < B.id group by B.id Upvote 0 Downvote
Assuming the table has a unique id, then row number can be generated for the duration of the query by a self join. Select count(*) as rownum,B.id From WoTable A inner join WoTable B On A.id <> B.id where A.id < B.id group by B.id
Sep 29, 2005 #4 BoxHead Technical User May 6, 2001 876 US cmmrfrds, Thanks for that. I had to change the <> to <= and <B.id to <=B.id because one of my unique id values is 1. I'll get a lot of use out of this. John Use what you have, Learn what you can, Create what you need. Upvote 0 Downvote
cmmrfrds, Thanks for that. I had to change the <> to <= and <B.id to <=B.id because one of my unique id values is 1. I'll get a lot of use out of this. John Use what you have, Learn what you can, Create what you need.
Sep 29, 2005 1 #5 PHV MIS Nov 8, 2002 53,708 FR A ranking query may use a theta join: Select count(*) as rownum,B.id From WoTable A inner join WoTable B On A.id <= B.id group by B.id Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
A ranking query may use a theta join: Select count(*) as rownum,B.id From WoTable A inner join WoTable B On A.id <= B.id group by B.id Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Sep 29, 2005 Thread starter #6 Recce Programmer Aug 28, 2002 425 ZA Thanks everyone. These are some ideas. "We know nothing but, that what we know is not the truth..." - Me Upvote 0 Downvote
Thanks everyone. These are some ideas. "We know nothing but, that what we know is not the truth..." - Me