Hi folks
I have a query to return a numbers of rows (about 3500).
The results of this query will be used to load a table in a SQL database.
This target table requires that I include a unique identifier (number) in one of the fields.
I have 2 alternate solutions.
1. I can simply export the results to XL and use the autofill function.
2. I can make a "create table" query and let the system add its own ID.
However, both of these solutions demand multiple steps to get an end result.
Surely I could simply get my query to create the required field that includes the RowNumber in the returned data set?
So - assuming MyTable consist of
FName SName Role
Freddy Bloggs Bean Counter
Harrold Smitth Engineer
George George Duplicator
My query would look something like
select * from MyTable,
(select Row.Number() as RowCounter)
which will return
FName SName Role RowCounter
Freddy Bloggs Bean Counter 1
Harrold Smitth Engineer 2
George George Duplicator 3
I have trawled through a number of forums and have found part solutions that dont seem to work.
Thanks
I have a query to return a numbers of rows (about 3500).
The results of this query will be used to load a table in a SQL database.
This target table requires that I include a unique identifier (number) in one of the fields.
I have 2 alternate solutions.
1. I can simply export the results to XL and use the autofill function.
2. I can make a "create table" query and let the system add its own ID.
However, both of these solutions demand multiple steps to get an end result.
Surely I could simply get my query to create the required field that includes the RowNumber in the returned data set?
So - assuming MyTable consist of
FName SName Role
Freddy Bloggs Bean Counter
Harrold Smitth Engineer
George George Duplicator
My query would look something like
select * from MyTable,
(select Row.Number() as RowCounter)
which will return
FName SName Role RowCounter
Freddy Bloggs Bean Counter 1
Harrold Smitth Engineer 2
George George Duplicator 3
I have trawled through a number of forums and have found part solutions that dont seem to work.
Thanks