title: Delete using subquery and intersect?
body: <p>I am trying to delete using the below query but unfortunately, all the records are deleted </p>
  
  <pre><code>DELETE [dbo].[devicelinks]
  FROM   
      (SELECT *
       FROM [dbo].[devicelinks]
       WHERE PID = 7
  
       INTERSECT 
  
       SELECT * 
       FROM ASC.dbo.DEVICE_LINK
       WHERE PID = 7)
  </code></pre>
  
  <p>How to properly use the subquery to delete the  corresponding records from the source table?</p>
  
  <p>No keys or constraints in either of the two tables.</p>