SQL - Mailing list pgsql-novice

From cristi
Subject SQL
Date
Msg-id 008b01c28a17$1bdc52a0$7201a8c0@aaa
Whole thread Raw
In response to Cancelling long running query?  ("Patrick Hatcher" <PHatcher@macys.com>)
Responses Re: SQL
Re: SQL
List pgsql-novice
I have a table a:
create tabel a( marca int4,
                       mo varchar(1)
                    );

This is the contents of the table:
marca     mo
1            C
2            C
4            B
5            O
1            C
1            B

I need a SQL interogation with following results:

marca concedii boala obligatii
  1         2           1        0
  2         1            0       0
  4         0            1       0
  5         0            0       1

How can I do that?


Thanks!


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cancelling long running query?
Next
From: "Rob"
Date:
Subject: Re: SQL