July 8, 2007 at 11:26 pm
I have a table like below
Table1
Col1 col2 col3
RA1 NULL NULL
RA2 NULL NULL
RA3 NULL NULL
Col2 and Col3 are Null NOW. Col2 needs to be populated as BON001 to BON004000. Fix prefix BON00+ One number(From 1 to 4000 each) for each records. Similarly Col3 should have RBO001 to RBO4000. Thus table records looks like this.
Col1 col2 col3
RA1 BON001 RBO001
RA2 BON002 RBO002
....... ...... ........
RA3 BNO004000 RBO4000
Could anybody please provide me the script how we can achieve above.
Thanks a lot
July 9, 2007 at 2:25 am
Hello,
just a few questions before we can start thinking about a solution...
How do we know which row should get which number (of the 1 - 4000)? Or is it OK to fill the numbers in any order? Since you are showing the row with 'RA3' in Col1 having BNO004000, we have no clue as to the ordering.
Also, what about the format of Col2? Is it OK that first row has the number part 001, while the last has 004000, or is that a mistake? I would suppose some leading zeroes to the smaller numbers (like 000001), so that all the numbers are equally long - otherwise you have no chance to order by that column. Column 3 is even worse that that, because it seems to compensate a bit for the length, but not fully... adds only 2 leading zeroes instead of at least 3.
July 10, 2007 at 10:45 am
July 10, 2007 at 6:43 pm
How in the heck does RA3 equate to an RBO of 4000??? And, what is the primary key of the table? We need some more info on this one, for sure.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply