Skip site navigation (1) Skip section navigation (2)

SQL

From: "cristi" <cristi(at)dmhi(dot)ct(dot)ro>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: SQL
Date: 2002-11-12 06:45:37
Message-ID: 008b01c28a17$1bdc52a0$7201a8c0@aaa (view raw or flat)
Thread:
Lists: 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!


In response to

Responses

  • Re: SQL at 2002-11-12 07:42:30 from Rob
  • Re: SQL at 2002-11-12 09:28:46 from Manfred Koizar

pgsql-novice by date

Next:From: RobDate: 2002-11-12 07:42:30
Subject: Re: SQL
Previous:From: YC NyonDate: 2002-11-12 02:14:07
Subject: Re: SQL statement to copy a result set to create another table.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group