-
How to write a query to update alternate rows in a Table.
I mean whether all even rows or all odd rows should be updated from the query.
Is there any way to increase the performance if million of rows are there in some table.and if i want to update all the rows (single column in each row) then how can be make the process fast.
Thanks in Advance !
Ashish
-
Hi Ashish,
Maybe is will give some answers:
update my_table
set my_column = my_value
where mod(my_row_number,2) = 0;
Using the rownum is a very dangerous way, it is assigned dynamicly, so it is not always the same number for the same row
Increasing performance can be achieved by:
1 Partitioning and parallel processing
2 When updating some rows, use a proper index (function, bitmap, ...)
Regards
Ben de Boer
-
Hello
This is also not working as it is showing that 0rows updated
AShish
-
What did you use for 'my_row_number'
Show me your query
Regards
Ben de Boer
-
Hi,
Bensr's query works absolutely fine.
Take Care.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|