title: How do I create a temp table using this snippet?
body: <p>how do i produce this SQL snippet as a temp table so I can join some other stuff into it?</p>
  
  <pre><code>with MyCTE AS
  (
      select *, RANK() OVER (PARTITION BY workplace ORDER BY Total DESC) AS Rank
      from [dbo].[OriginDestination]
  )
  select * from MyCTE where Rank &lt;= 5
  </code></pre>