PostgreSQL Delete Query

Delete query is used to delete records of objects.

Syntax:

[ WITH [ RECURSIVE ] with_query [, …] ]
DELETE FROM [ ONLY ] table_name [ * ] [ [ AS ] alias ]
[ USING using_list ]
[ WHERE condition | WHERE CURRENT OF cursor_name ]
[ RETURNING * | output_expression [ [ AS ] output_name ] [, …] ]

Examples:

PostgreSQL emp table

Delete rows where salary is greater than 4000 from emp table.

delete from emp where sal >4000;

PostgreSQL Delete Query

Powered by k2schools