Thursday, 3 October 2013

I need to write a query which repeats the rows by incrementing the values

I need to write a query which repeats the rows by incrementing the values

I have a table with three columns say ID with identity, name and location
and for this columns say I have values as
(1,'RAM','CA'),
(2,'SAM','IA'),
(3,'PAM','MI')
etc....
Now want to get 100 rows, say after 3rd row, the 4th row should again
start with same name and same location but adding one value to it, say 4th
row will be values (4,'RAM1','CA1'), similarly 5th row will be
(5,'SAM1','IA1') and 6th row will be (6,'PAM1','MI1'). Again for 7th row
it should give values as (7,'RAM2','CA2') and so on. So it should continue
like this till 100th row, for that I need to write the code, I could not
able to figure it out, can you please help me in this.
Thanks, Aparanjit

No comments:

Post a Comment