PostgreSQL DML Operations: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 6: | Line 6: | ||
{{Internal|SQL_INSERT#Overview|Standard SQL <tt>INSERT</tt>}} | {{Internal|SQL_INSERT#Overview|Standard SQL <tt>INSERT</tt>}} | ||
<syntaxhighlight lang='sql'> | <syntaxhighlight lang='sql'> | ||
INSERT INTO | INSERT INTO person ("id", "name") VALUES (10, 'Bob') | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 12: | Line 12: | ||
{{Internal|SQL_UPDATE#Overview|Standard SQL <tt>UPDATE</tt>}} | {{Internal|SQL_UPDATE#Overview|Standard SQL <tt>UPDATE</tt>}} | ||
<syntaxhighlight lang='sql'> | <syntaxhighlight lang='sql'> | ||
UPDATE | UPDATE person SET "id"=50 WHERE "name"='Bob' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 18: | Line 18: | ||
{{Internal|SQL_DELETE#Overview|Standard SQL <tt>DELETE</tt>}} | {{Internal|SQL_DELETE#Overview|Standard SQL <tt>DELETE</tt>}} | ||
<syntaxhighlight lang='sql'> | <syntaxhighlight lang='sql'> | ||
DELETE FROM | DELETE FROM person WHERE "id"=10 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 24: | Line 24: | ||
{{Internal|SQL_SELECT#Overview|Standard SQL <tt>SELECT</tt>}} | {{Internal|SQL_SELECT#Overview|Standard SQL <tt>SELECT</tt>}} | ||
<syntaxhighlight lang='sql'> | <syntaxhighlight lang='sql'> | ||
SELECT " | SELECT "id", "name" FROM person | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 23:26, 22 May 2024
Internal
INSERT
INSERT INTO person ("id", "name") VALUES (10, 'Bob')
UPDATE
UPDATE person SET "id"=50 WHERE "name"='Bob'
DELETE
DELETE FROM person WHERE "id"=10
SELECT
SELECT "id", "name" FROM person