About 260,000 results
Open links in new tab
  1. sql - db2: update multiple rows and field with a select on a different ...

    Dec 12, 2011 · DB2 and the SQL standard don't have a FROM clause in an UPDATE statement. So you have to clearly separate the steps to identify the rows to be modified and to compute the new value. . …

  2. sql - How to update multiple columns in single update statement in …

    Mar 26, 2014 · I want to update multiple columns of a table in DB2 with single Update statement. Any hint or idea will be appreciable. Thanks.

  3. INNER JOIN in UPDATE sql for DB2 - Stack Overflow

    Nov 15, 2010 · Referring to tables as files, though, leads me to believe that you're NOT running DB2 on Linux, UNIX or Windows (LUW). However, if you are on DB2 LUW, see the MERGE statement: …

  4. Correct syntax for insert or update trigger in db2

    Mar 9, 2025 · 0 I’m trying to create a single trigger to check a date on insert or update in a table. I’ve seen In DB2, is it possible to have just a single trigger for both update and insert? which suggests …

  5. DB2 - SQL UPDATE statement using JOINS and SELECT statement

    Dec 6, 2022 · Morning, I'm running the following SELECT statement on a DB2 server (IBM Power System) and it returns the latest record from tableB based on a Timestamp (all good). SELECT * …

  6. Update using select in DB2 - Database Administrators Stack Exchange

    Apr 26, 2018 · An UPDATE without WHERE clause will update all the rows of the table. For those rows that don't have a matching address_id in table B, the subquery returns an empty result set, so the …

  7. Can a DB2 WITH statement be used as part of an UPDATE or MERGE?

    1 If you're running DB2 V8 or later, there's an interesting SQL hack here that allows you to UPDATE/INSERT in a query with a WITH statement. For inserts & updates that require a lot of …

  8. sql - Does DB2 have an "insert or update" statement? - Stack Overflow

    11 This response is to hopefully fully answer the query MrSimpleMind had in use-update-and-insert-in-same-query and to provide a working simple example of the DB2 MERGE statement with a scenario …

  9. How do I write an SQL statement (for DB2) to update a table with these ...

    Apr 1, 2014 · Here's what I need to do: For each row in Table1 where Name is not null or blank, and Table2 has a row with matching Name, replace another column in Table1 with the contents of a …

  10. triggers - Update the parent table DB2 change primary key and error …

    Mar 21, 2025 · Request to write and explain the operation of a trigger that will first update the parent table TAB1 (update in the code) and then TAB2. I get this error: ERROR: SQL ERROR [23504]: THE …