1 Reply Latest reply on Feb 13, 2017 8:44 AM by shawkins

    Count(1) vs Count(*) with group by

    hend.amin

      Hello,

      I had a query  select x, count(1) from myTable group by x;

      The count was wrong.

      However when i used  select x, count(*) from myTable group by x; the results were correct.

      What does count(1) vs count(*) do ?

        • 1. Re: Count(1) vs Count(*) with group by
          shawkins

          > What does count(1) vs count(*) do ?

           

          Normally you would expect them to be the same.

           

          To determine why they are different, we'll need a fuller picture of what is happening here. 

           

          - a query plan

          - what source(s) are being targeted

          - the Teiid version