Αποτελέσματα Αναζήτησης
If you want to update specific rows (ie where the IDs match) you probably want to do a coordinated subquery. However, since you are using Oracle, it might be easier to create a materialized view for your query table and let Oracle's transaction mechanism handle the details.
6 Δεκ 2017 · Learn about several methods to update data using subqueries in UPDATE statements to make them more effective and easier to maintain in Oracle SQL.
Subquery Method. The first option is to do an update of the DEST_TAB table using a subquery to pull the correct data from the SOURCE_TAB table. Notice the EXISTS predicate to exclude rows from the DEST_TAB table with no matching row in the SOURCE_TAB table.
4 Μαρ 2021 · An easier approach is to use row_number(). You can assign the rows increasing values based on your ordering. You can then assign order_col to the values this returns: CHRIS>update t set order_col = null; 5 rows updated.
Use the UPDATE statement to change existing values in a table or in the base table of a view or the master table of a materialized view. Prerequisites. For you to update values in a table, the table must be in your own schema or you must have the UPDATE object privilege on the table. For you to update values in the base table of a view:
A subquery is a SELECT statement nested inside another statement such as SELECT, INSERT, UPDATE, or DELETE. Typically, you can use a subquery anywhere that you use an expression. Consider this following subquery example that uses the products table from the sample database.
27 Μαΐ 2011 · Looking up the UPDATE statement syntax on oracle, I found the following link, which shows that you can use a subquery in place of a table name. When I tried to write the query like this, I got a "ORA-01779: Cannot modify a column which maps to a non key-preserved table". UPDATE. (. SELECT.