Home > database >  Oracle to modify query result set cycle
Oracle to modify query result set cycle

Time:10-02

Table A ANO fields with XXX | | XXX | | XXXX | | variable composition, variable is generated by A process of encryption, now numbering generate repeat, I'd like to have the serial number of repeat to regenerate, namely modifying repeating ANO=now ANO top X | | call variable generation process,

CodePudding user response:

The building Lord said your specific, practical operation and your description is the same,

CodePudding user response:

The paper gives an example of data and expected results

CodePudding user response:

reference 1st floor selling fruit net reply:
the original poster said your specific issues, the actual operation is the same, and your description
I write is not assembly, logic is probably so

CodePudding user response:

Data such as
10360073070002992320
10360073070002992321
10360073070002992322
10360073070002992322
10360073070002992323
10360073070002992323
10360073070002992324
10360073070002992325
10360073070002992325



Have private 22.23.25, repeat, now need to modify,
Before 1036007307, after ten by calling a encryption method generates output parameters,
For example, want to get the results as follows:
10360073070002992320
10360073070002992321
10360073070002992322 or this also reset
1036007307 + reset number 1
10360073070002992323 or this also reset
1036007307 + reset number 2
10360073070002992324
10360073070002992325 or this also reset
1036007307 + reset number 3

CodePudding user response:

I didn't write this way has a good way to
Declare
Temp varchar2 (4096)
The Begin
The Loop cycle (
Should be in duplicate data query to the circulation, this won't write)
Calls to generate number method f number temp;
Update a set a.a no=substr (a.a, 0, 10)//temp;
Commit;
End loop;
The End;
Probably is this meaning

CodePudding user response:

If so, you only have to intercept back ten group by then, having the count (*) & gt; 1 line

CodePudding user response:

Wrong is to change the data, you first find out one of the biggest value is how much, and then write a cursor detect duplicate data rowid (can use analysis function queries), then use the largest value + 1 update each cycle

CodePudding user response:

refer to 7th floor sxq129601 response:
wrong is to change the data, you first find out one of the biggest value is how much, and then write a cursor data found to repeat the rowid (can use analysis function queries), then use the largest value + 1 update each cycle
no, don't understand

CodePudding user response:

I write good, thanks man
  • Related