title: SQL Query Grab 2 different Ids same table, join and query
body: <p>Trying to take ID 2 and ID 3 Join them. </p>
  
  <p>So grab 2 columns from table, ID and query, grab the 2 different IDs from table and then join them together. </p>
  
  <pre><code>SELECT a.ID, a.SQLQuery
  FROM (SELECT ID, SQLQuery
        FROM dbo.ReportQuery
        WHERE (ID = 2)) AS a 
  INNER JOIN (SELECT ID, SQLQuery
              FROM dbo.ReportQuery AS ReportQuery_1
              WHERE (ID = 3)) AS b ON a.ID = b.ID
  </code></pre>
  
  <p>Sample Data</p>
  
  <p>Here is some sample data. Trying to grab ID=2, and ID=3 and combine them into a single statement. </p>
  
  <pre><code>    ID     SQLQuery
      1      Select * from users where plc_id like @PLC_ID
      2      Select * from stepgrouplog where (EndDateTime = '2009')
      3      Select * from tmp_kosherStatus where unit=@unit
  </code></pre>