title: Sub query needed for this condition?
body: <p>This query is pulling the data correctly in the format I need, but there is a condition that I can't seem to be able to break out...I only want to pull the catalog numbers (sCat) where the text code (stxttype) has a 'NEURPIC' and also a corresponding 'IDURPIC'.  Both conditions must be met.  So stating stxttype IN ('NEURPIC', 'IDURPIC') is not working because it's pulling any catalog number that either or.  Essentially I will need to wipe out the 'NEURPIC' so I need to make sure that the catalog number has both a 'NEURPIC' and 'IDURPIC'.  It's pretty much a duplicate URL that was coded incorrectly which is why I will need to delete.  Thanks in advance as always.  </p>
  
  <pre><code>DECLARE @nIdPub int
  
  SELECT  @nIdPub = 12439 
  
  SELECT     'TX1.0P'                     AS [Record ID]
  , ''                                    AS [Seller ID Qualifier]
  , tbCo.nIdIdw                           AS [IDW Private ID]
  , CONVERT(smalldatetime,getdate(), 112) AS [Time Stamp]
  , 'C'                                   AS [Update Status]
  , ISNULL(tbItem.sUpc, '')               AS [UPC]    
  , ISNULL(tbItem.sGtin, '')              AS [GTIN]               
  , ISNULL(tbItem.sEan, '')               AS [EAN]            
  , tbItem.sCat                           AS [Catalog Number]
  , tbItemTxt.sTxtType                    AS [Type Code]
  , tbItemTxt.sTxt                        AS [Text]
  , tbItemTxt.sLang                       AS [Language Code]
  
  FROM        tbItemTxt INNER JOIN
          tbItem ON tbItemTxt.nItemId = tbItem.nItemId INNER JOIN
          tbCo ON tbItem.nIdPub = tbCo.nIdPub
  
  WHERE       tbItem.nIdPub = @nIdPub
  and tbItemTxt.sTxtType LIKE '%URPIC%'
  
  ORDER by sCat
  </code></pre>
  
  <p>The expected results should be as follows...</p>
  
  <pre><code>sCat        sTxtType
  11455        IDURPIC
  11455        NEURPIC
  22335        IDURPIC
  22335        NEURPIC
  45678        IDURPIC
  45678        NEURPIC
  </code></pre>