( '1', '', 'PostgreSQL Tutorial', 'Learn PostgreSQL fast and easy', 'follow', ''), The following statements create a new table called links and insert some sample data: DROP TABLE IF EXISTS links Let’s set up a sample table for the demonstration. If you want to change the structure of a table such as removing a column, you should use the ALTER TABLE statement. It doesn’t modify the structure of the table. Note that the DELETE statement only removes data from a table. To return specific columns, you specify them after the RETURNING keyword. The asterisk ( *) allows you to return all columns of the deleted row from the table_name. RETURNING (select_list | *) Code language: SQL (Structured Query Language) ( sql ) To return the deleted row(s) to the client, you use the RETURNING clause as follows: DELETE FROM table_name It returns zero if the DELETE statement did not delete any row. The DELETE statement returns the number of rows deleted. If you omit the WHERE clause, the DELETE statement will delete all rows in the table. Second, use a condition in the WHERE clause to specify which rows from the table to delete.First, specify the name of the table from which you want to delete data after the DELETE FROM keywords.WHERE condition Code language: SQL (Structured Query Language) ( sql ) The following shows basic syntax of the DELETE statement: DELETE FROM table_name The PostgreSQL DELETE statement allows you to delete one or more rows from a table. Introduction to PostgreSQL DELETE statement Summary: in this tutorial, you will learn how to use the PostgreSQL DELETE statement to delete data from a table.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |