It's a little bit tricky to delete from a table while using any type of JOIN in SQL like Inner Join, Left Outer Join, or Right Outer Join. The obvious syntax doesn't work as shown below:
here I have a table with a list of expired deals that I want to delete from the Deals tables, but only for Sony.
delete from #Expired e INNER JOIN
Deals d ON e.DealId = d.DealId
Where d.Brand = 'Sony'
here I have a table with a list of expired deals that I want to delete from the Deals tables, but only for Sony.