Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-6077

COUNT OVER gives different result if one of the columns has translate() in WHERE clause

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 15.0.2, 16.0.1, 17.0
    • 10.1, 12.2, 16.0
    • Query Engine
    • None
    • Undefined

      Query

      select id, count(id) over () count from mytable where translate(id, '', '') = '1'

       gives result:

      [id, number of all rows in table]

      expected result is  (postgres gives this result):

      [id, number of all rows satisfying the where clause]
      

      If I put the translated column also into the count, it gives the expected result.

      select id, count(translate(id, '', '')) over () count from mytable where translate(id, '', '') = '1'

       

              rhn-engineering-shawkins Steven Hawkins
              basmastr Tomáš Tomek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: