I have the following query.
SELECT T2.* FROM Schema.Table1 T1 INNER JOIN
Schema.Table2 T2 ON T1.ColumnName = T2.ColumnName
WHERE T1.SomeOtherColumn = 123456
I want to delete everything from above query (everything from table 2 that has matching output based on Inner Join and Where clause.
I tried the following but not working.
DELETE Schema.T2.* FROM Schema.Table2 T2 INNER JOIN
Schema.Table1 T1 ON T1.ColumnName = T2.ColumnName
WHERE T1.SomeOtherColumn = 123456
Please help!
EDIT:
Thank you guys. TIL FROM can be used twice without using it in subquery format. 🙂
1 Answer