PostgreSQL DML Operations: Difference between revisions
Jump to navigation
Jump to search
(→UPDATE) |
(→DELETE) |
||
Line 19: | Line 19: | ||
{{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 person WHERE | DELETE FROM person WHERE id=10 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Double quotes can be used around column names. | |||
=<TT>SELECT</TT>= | =<TT>SELECT</TT>= |
Revision as of 19:32, 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
Double quotes can be used around column names.
SELECT
SELECT "id", "name" FROM person