PostgreSQL DML Operations: Difference between revisions

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


=<TT>DELETE</TT>=
=<TT>DELETE</TT>=
{{Internal|SQL_DELETE#Overview|Standard SQL <tt>DELETE</tt>}}
<syntaxhighlight lang='sql'>
<syntaxhighlight lang='sql'>
DELETE FROM TEST WHERE "ID"=10
DELETE FROM TEST WHERE "ID"=10
</syntaxhighlight>
</syntaxhighlight>
=<TT>SELECT</TT>=
=<TT>SELECT</TT>=
<syntaxhighlight lang='sql'>
<syntaxhighlight lang='sql'>
SELECT "ID", "NAME" FROM TEST
SELECT "ID", "NAME" FROM TEST
</syntaxhighlight>
</syntaxhighlight>

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

Standard SQL DELETE
DELETE FROM TEST WHERE "ID"=10

SELECT

SELECT "ID", "NAME" FROM TEST