title: Insert Query in SQL Server
body: <p>I have this table <code>TAB</code></p>
  
  <pre><code>ID | Trans
  ------------
  1  | 99
  2  | 99
  3  | 99
  2  | 90
  4  | 22
  4  | 22
  2  | 99
  2  | 90
  </code></pre>
  
  <p>I want to get the count of trans that appear together for a single id, for eg, '1 has 90 &amp; 99' and '2 has 90 &amp; 99' in the entire table so the count is 2. This is similar to Apriori Algorithm's Third Step.</p>
  
  <p>I tried this but didn't work-</p>
  
  <pre><code>select 
      count(trans) 
  from 
      Tab 
  where 
      trans = 99 &amp; 90  
  group by 
      ID 
  having 
      ID = 2
  </code></pre>
  
  <p>My expected ans for Trans- 90 &amp; 99 is</p>
  
  <p>Trans1 | Trans2 | Support
      ------------</p>
  
  <p>90  | 99    |  1</p>
  
  <p>I also want to insert this into a new table.</p>