DELETE t1
FROM Table1 t1
JOIN Table2 t2 ON t1.ID = t2.ID;
I always use the alias in the delete statement as it prevents the accidental
DELETE Table1
caused when failing to highlight the whole query before running it.
More Related Contents:
- Receive an unexpected symbol error in my PLSQL query [closed]
- Split data of columns in (if of is not null data of is null) [closed]
- SQL Sum of Field [closed]
- SQL
- Subquery using Exists 1 or Exists *
- Most efficient T-SQL way to pad a varchar on the left to a certain length?
- SQL – How to store and navigate hierarchies?
- Optimize query with OFFSET on large table
- Conditional Count on a field
- single fixed table with multiple columns vs flexible abstract tables
- Why does this SQL code give error 1066 (Not unique table/alias: ‘user’)?
- Does SparkSQL support subquery?
- PostgreSQL: encoding problems on Windows when using psql command line utility
- Composite Primary key vs additional “ID” column?
- Saving changes after table edit in SQL Server Management Studio
- Logging ALL Queries on a SQL Server 2008 Express Database?
- SQL query to find Nth highest salary from a salary table
- Aggregate a single column in query with many columns
- How to get export output in “real” CSV format in SQL Server Management Studio?
- Protecting against SQL injection in python
- SELECT INTO using Oracle
- Script to save varbinary data to disk
- Access to Result sets from within Stored procedures Transact-SQL SQL Server
- Does Postgres support nested or autonomous transactions?
- `show create table` equivalent in oracle sql
- ORA-00972 identifier is too long alias column name
- The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions
- What is the meaning of SELECT … FOR XML PATH(‘ ‘),1,1)?
- SQL Sort Order with Null values last
- SQLite query, ‘LIKE’