KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using UPDATE and OFFSET in SQL
PRODUCT: 4D | VERSION: 13.4 | PLATFORM: Mac & Win
Published On: February 6, 2014

The UPDATE clause in SQL typically uses the SET and WHERE clauses to target certain areas of the data. But it is possible to use the OFFSET clause in a UPDATE. It is acheived by using the SELECT command in the WHERE clause.

Here is an example SQL statement:

Begin SQL
    UPDATE Table_1 SET Field_1 = 'D'
    WHERE
    (row_ID in
    (SELECT row_ID FROM Table_1 WHERE Field_1 <> 'D' OFFSET 1)
    )

End SQL