Cross-classified table - Mailing list pgsql-novice

From Alexander Pucher
Subject Cross-classified table
Date
Msg-id 3F9406D0.2010404@atlas.gis.univie.ac.at
Whole thread Raw
Responses Re: Cross-classified table
List pgsql-novice
Hi,
I'm looking for the correct syntax of getting a cross-classified table
from my SELECT statement.

Let's pretend I have this table:


origin        sex
----------------
USA        male
USA        female
China      male
China      male
UK           male
USA        male


and I want as result something like:

               male      female

USA        2            1
China      2            0
UK           1            0


How can I get this?

Best regards,
alex





pgsql-novice by date:

Previous
From: Susan Evans
Date:
Subject: SSL Error
Next
From: Bruno LEVEQUE
Date:
Subject: Re: Cross-classified table