Recently, due to the need of the project, I have been searching for a function to update the data of another table based on the content of one table in Oracle. I haven't found a proper method on the Internet for a long time. Although
Recently, due to the need of the project, I have been searching for a function to update the data of another table based on the content of one table in Oracle. I haven't found a proper method on the Internet for a long time. Although
Recently, due to the need of the project, I have been searching for a function to update the data of another table based on the content of one table in Oracle. I haven't found a proper method on the Internet for a long time, although we can see that it can be implemented through the stored procedure, it is too troublesome. Now we find merge in Oracle when searching for the same function, so it took some time to implement this function in a simple way. The syntax is free of charge. You can search for a bunch of statements on the Internet and check the specific statements. The Code is also relatively simple and can be understood literally. The simplest version should be:
The statement in the specific project is:
Merge provides the update and insert functions. If no match is found through the On relationship, the result is added. If you only want to update data, you only need to comment out the insert operation.