PostgreSQL DML Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:


=<TT>UPDATE</TT>=
=<TT>UPDATE</TT>=
{{Internal|SQL_UPDATE#Overview|Standard SQL <tt>UPDATE</tt>}}
<syntaxhighlight lang='sql'>
<syntaxhighlight lang='sql'>
UPDATE TEST SET "ID"=50 WHERE "NAME"='Bob'
UPDATE TEST SET "ID"=50 WHERE "NAME"='Bob'
</syntaxhighlight>
</syntaxhighlight>
=<TT>DELETE</TT>=
=<TT>DELETE</TT>=
<syntaxhighlight lang='sql'>
<syntaxhighlight lang='sql'>

Revision as of 22:44, 22 May 2024

Internal

INSERT

Standard SQL INSERT
INSERT INTO TEST ("ID", "NAME") VALUES (10, 'Bob')

UPDATE

Standard SQL UPDATE
UPDATE TEST SET "ID"=50 WHERE "NAME"='Bob'

DELETE

DELETE FROM TEST WHERE "ID"=10

SELECT

SELECT "ID", "NAME" FROM TEST