In response to Tim Landscheidt :
> "A. Kretschmer" <andreas.kretschmer@schollglas.com> wrote:
>
> > [...]
> > test=*# select foo.status_v, count(myt.status_v) from myt right join (select unnest(array['I','P','X']) as
status_v)foo on foo.status_v=myt.status_v group by foo.status_v;
>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > status_v | count
> > ----------+-------
> > X | 0
> > I | 1
> > P | 2
> > (3 rows)
>
> You can also write this as "(VALUES ('I'), ('P'), ('X')) AS
> foo (status_v)" which I personally find more readable (con-
> stant vs. function).
You are right, thx.
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99