Skip to main content

Count distinct over a window resulting in error 4249 when using Vertica v7.1.1-2

  • January 13, 2015
  • 0 replies
  • 6 views

Tahir_Butt
Notice that count distinct without a window clause works fine but throws an error when a window is included.
rna=> select version();              version
------------------------------------
 Vertica Analytic Database v7.1.1-2
(1 row)
rna=> select count(version) from (select version()) x;
 count
-------
     1
(1 row)
rna=> select count(distinct version) from (select version()) x;
 count
-------
     1
(1 row)
rna=> select x, count(version)over(partition by x) from (select 1 x, version()) x;
 x | ?column?
---+----------
 1 |        1
(1 row)
rna=> select x, count(distinct version)over(partition by x) from (select 1 x, version()) x;