Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads

2.9. Deletions

Rows can be removed from a table using theDELETE command. Suppose you are no longer interested in the weather of Hayward. Then you can do the following to delete those rows from the table:

DELETE FROM weather WHERE city = 'Hayward';

All weather records belonging to Hayward are removed.

SELECT * FROM weather;

     city      | temp_lo | temp_hi | prcp |    date---------------+---------+---------+------+------------ San Francisco |      46 |      50 | 0.25 | 1994-11-27 San Francisco |      41 |      55 |    0 | 1994-11-29(2 rows)

One should be wary of statements of the form

DELETE FROMtablename;

Without a qualification,DELETE will removeall rows from the given table, leaving it empty. The system will not request confirmation before doing this!


PrevHomeNext
UpdatesUpAdvanced Features
Go to PostgreSQL 9.4
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp