![]() It means that the USING clause may not available in other database systems. The USING clause is not a part of the SQL standard. Third, query data from the contacts table: SELECT * FROM contacts Code language: SQL (Structured Query Language) ( sql ) Delete join using a subquery Output: DELETE 2 Code language: Shell Session ( shell ) WHERE contacts.phone = blacklist.phone Code language: SQL (Structured Query Language) ( sql ) Second, delete the contacts in the contacts table with the phone number exists in the blacklist table: DELETE FROM contacts ( '(408)-511-9876') Code language: SQL (Structured Query Language) ( sql ) INSERT INTO contacts(first_name, last_name, phone) Then, use columns from the tables that appear in the USING clause in the WHERE clause for joining data.įor example, the following statement uses the DELETE statement with the USING clause to delete data from t1 that has the same id as t2: DELETE FROM t1įirst, use the following statements to create two tables: contacts and blacklist: DROP TABLE IF EXISTS contacts.First, specify the table expression after the USING keyword. ![]() RETURNING returning_columns Code language: SQL (Structured Query Language) ( sql ) The following shows the syntax of the DELETE statement with the USING clause: DELETE FROM table_name1 However, it does support the USING clause in the DELETE statement that provides similar functionality as the DELETE JOIN. PostgreSQL doesn’t support the DELETE JOIN statement. Introduction to PostgreSQL DELETE statement with USING clause Summary: in this tutorial, you will learn how to use the PostgreSQL DELETE statement to emulate delete join operations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |