PostgreSQL DML Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
INSERT INTO TEST ("ID", "NAME") VALUES (10, 'Bob')
INSERT INTO TEST ("ID", "NAME") VALUES (10, 'Bob')
</syntaxhighlight>
</syntaxhighlight>
=<TT>UPDATE</TT>=
=<TT>UPDATE</TT>=
<syntaxhighlight lang='sql'>
UPDATE TEST SET "ID"=50 WHERE "NAME"='Bob'
</syntaxhighlight>
=<TT>DELETE</TT>=
=<TT>DELETE</TT>=
<syntaxhighlight lang='sql'>
DELETE FROM TEST WHERE "ID"=10
</syntaxhighlight>
=<TT>SELECT</TT>=
=<TT>SELECT</TT>=
<syntaxhighlight lang='sql'>
SELECT "ID", "NAME" FROM TEST
</syntaxhighlight>

Revision as of 04:01, 14 October 2023

Internal

INSERT

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

UPDATE

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

DELETE

DELETE FROM TEST WHERE "ID"=10

SELECT

SELECT "ID", "NAME" FROM TEST