title: how to delete the results of a complex query
body: <p>When I replace <code>select *</code> with <code>delete</code> I get a syntax error on line 2 near t. But I need that t, because I'm referencing it in the where clause. So how do I delete the results of this query? </p>
  
  <pre><code>select *
      from [PrimusGroup].[dbo].[PrmsBlotter] t
      where t.RunType = 'Backtesting'
        and not exists (
          select 1
          from [PrimusGroup].[dbo].[PrmsBlotter] i
          where i.RunType = 'Live'
            and i.BBox = t.BBox
            and convert(date,i.RunDateStart) = convert(date,t.TestDateFrom)
      )
  </code></pre>