Re: Can it be done in SQL
Posted in 1996
Topics: Server Administration
Toby Denbow wrote:
> I want to insert some rows into a detail table. The question is how can
> I, in SQL, create line numbers for the rows being inserted without
> hardcoding them?
What are you calling a line number? Do you mean a unique, sequential
number for each row?
> For example I want the_line_number to be incremented for each row os that
> line_no is a valid line_no.
What is valid?
> EXAMPLE:
> insert into line_no, col1, col2
> select the_line_number, table.col1, table.col2 from table where col2 = "a"
Toby, if all you want is SQL to create unique sequential row IDs, then
I can steer you in the right direction. Otherwise, I need more info
about what you are trying to do.
--Rusty
--------------------------------------------------
Rusty Alderson, RCA Client/Server Solutions:
Sybase DBA, DB-Library Development, C/C++, MFC
Powerbuilder Development, Project Management
--------------------------------------------------