PostgreSQL DML Operations: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(→INSERT) |
||
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 person ( | INSERT INTO person (id, name) VALUES (10, 'Bob') | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Note: Use single quotes for the string values. Double quotes will let the SQL interpreter think you use a column name. | |||
=<TT>UPDATE</TT>= | =<TT>UPDATE</TT>= |
Revision as of 19:31, 24 May 2024
Internal
INSERT
INSERT INTO person (id, name) VALUES (10, 'Bob')
Note: Use single quotes for the string values. Double quotes will let the SQL interpreter think you use a column name.
UPDATE
UPDATE person SET "id"=50 WHERE "name"='Bob'
DELETE
DELETE FROM person WHERE "id"=10
SELECT
SELECT "id", "name" FROM person