9951 explained code solutions for 126 technologies


postgresqlHow can I set a PostgreSQL interval to zero?


To set a PostgreSQL interval to zero, you can use the interval '0' syntax. Here is an example of setting an interval column to zero:

UPDATE mytable
SET myinterval = interval '0'
WHERE id = 1

The output of the above command will be the number of rows affected.

Code explanation

  1. UPDATE mytable - This is the command to update a table.
  2. SET myinterval = interval '0' - This is the command to set a PostgreSQL interval to zero.
  3. WHERE id = 1 - This is the command to specify the row to update.

Helpful links

Edit this code on GitHub