2 Replies Latest reply on May 13, 2013 2:35 PM by shawkins

    bug with partition function

    blaxell

      Hi,

       

      i try to execute the following partition function on the adventureworks salestaxrate table

       

       

      SELECT

              "StateProvinceID"

              , COUNT(*) OVER (PARTITION BY a."CountryRegionCode") AS num

          FROM salestaxrate a

          WHERE "TaxType" = 3

       


      it returns me the correct result

       

       

      StateProvinceID num
      ......
      459
      ......

       

       

       

      But if I wrap it into a following select

       

       

      SELECT *

      FROM

      (

          SELECT

              "StateProvinceID"

              , COUNT(*) OVER (PARTITION BY a."CountryRegionCode") AS num

          FROM salestaxrate a

          WHERE "TaxType" = 3

      ) x

      WHERE "StateProvinceID" = 45

       

      it returns me

       

      StateProvinceID num
      45 1

       

      I'm running TEIID 8.1. Is it a known bug?