This is a discussion on update using merge within the Database Support forums, part of the Web Development category; Hello, In Oracle ,I want to update flag = 'Y' for all records whose enddate is not null. So i can ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hello, In Oracle ,I want to update flag = 'Y' for all records whose enddate is not null. So i can easily write a query update users set flag = 'Y' where enddate is not null. how can i achieve this using merge statement. Since i have 1 million records, my update is taking huge time. I want to write this query using merge statement. Plz help User id startDate enddate flag 1 10-jan-04 10-jan-04 1 11-mar-05 12-mar-05 1 11-mar-05 2 10-jan-04 10-jan-04 2 11-mar-05 12-mar-05 2 11-mar-05 etc etc etc etc
__________________ H2O Without us, no one can survive.. |
| Sponsored Links |
| |||
| Hi, Here is the solution... I created testing table with some testing records as per your requirement.. Quote:
Quote:
__________________ Keep smiling... |
| |||
| I'm having difficulty in working out why you think using merge over update will give you any benefits? As per MERGE Statement , merge is used to update or insert, whereas you appear to just need an update. Update is the way to go... |
| |||
| If i understand correctly your posting that you want to use a MERGE statement to improve the performance of your update. if you only to do a simple update then your update statement is correct. you will not need the MERGE statement unless you involve some other DML operations that you want to do at the same time. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| next Google update ? | Booom | 12 | 02-09-2008 08:59 PM | |
| How to Merge Images nearby aside. | oxygen | C# Programming | 3 | 10-26-2007 09:06 AM |
| Can I update two (or more) frames simultaneously? | GDevakii | HTML, CSS and Javascript Coding Techniques | 1 | 10-26-2007 07:17 AM |
| Update the value back | leoraja8 | Database Support | 4 | 09-27-2007 04:21 AM |
| What happened last update? | Joe | 1 | 02-21-2007 01:22 AM | |