title: Where statement with conditional subquery
body: <p>I want to use following Statement</p>
  
  <pre><code>DECLARE @MatnrFilter TABLE ( ListValue VARCHAR(50) )
  
  INSERT  INTO @MatnrFilter
      ( ListValue )
  VALUES  ( '167436' )
  INSERT  INTO @MatnrFilter
          ( ListValue )
  VALUES  ( '167447' )
  
  SELECT  *
  FROM    ios.BaseData_2013
  WHERE   Materialnummer IN ( CASE WHEN ( ( SELECT TOP 1
                                                  ListValue
                                        FROM      @MatnrFilter
                                      ) IS NULL ) THEN Materialnummer
                               ELSE ( SELECT  *
                                      FROM    @MatnrFilter
                                    )
                          END ) 
  </code></pre>
  
  <p>I want to filter just when there are values in @MtnrFilter. Here I am getting the error message </p>
  
  <pre><code>Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , &gt;, &gt;= or when the subquery is used as an expression.
  </code></pre>
  
  <p>Is there another way to do that?</p>
  
  <p>Tanks 
  Andi</p>