Search Postgresql Archives

Re: test aggregate functions without a dummy table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Willy-Bas Loos" <willybas@xxxxxxxxx> writes:
> I want to test the behavior of an an aggregate without creating a dummy
> table for it.
> But the code for it is horrible.
> Is there no simpler way?

> select max(foo)
> from (select 1 as foo union select 2 as foo)bar;

Perhaps VALUES?

regression=# select max(foo) from (values(1,2),(3,4),(5,6)) as v(foo,bar);
 max 
-----
   5
(1 row)


			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux