Hello,
In a given relationship table I have a column that holds the sort, however due to a problem in the application this column was populated with wrong data, as the example
|user_log
-------------------------------------------
|user_id |log_id |seq_num| created_date |
-------------------------------------------
|175300 |368501 |0 |
|175300 |368502 |0 |
|175300 |368503 |0 |
|175336 |368504 |0 |
|175389 |368505 |0 |
|175389 |368506 |0 |
I need to create a sql script, which corrects this sort order by populating the seq_num column with the creation order, determined by the created_date column. Example:
-------------------------------------------
|user_id |log_id |seq_num| created_date |
-------------------------------------------
|175300 |368501 |0 |
|175300 |368502 |1 |
|175300 |368503 |2 |
Does anyone have an idea how to mount this sql script? NOTE: The database is Oracle.