UPDATE
mutation is used to modify the existing records in a table. This support has limitations:
DELETE from table
without any condition is possible, but it will be much slower than just DROP TABLE table
.SET column=<value>
operation doesn’t support sub-SELECT as the value, also the WHERE
clause cannot contain sub-SELECT.UPDATE
mutation is as follows:
table
: The name of the table you want to update.column1, column2
: The columns that you wish to update.expression1, expression2
: The new values to assign to column1, column2, and so on. Each column is set to its corresponding expression.WHERE conditions
(Optional): The conditions that must be met for the update to execute. If no conditions are provided, all table records will be updated.status
column to “completed” for the record where task_id
is 1001.SELECT
query below:UPDATE
mutation updates the status to “completed” for the task with ID 1001.task_name
and status
columns for the record where task_id
is 1002.SELECT
query below: