Pivot table without crosstab - Mailing list pgsql-novice

From Lukasz Brodziak
Subject Pivot table without crosstab
Date
Msg-id CAGWYGjXCFRhCV7crEoO-KOF+busDt+OiDHsA=-pWfm2r16s4Ew@mail.gmail.com
Whole thread Raw
Responses Re: Pivot table without crosstab
List pgsql-novice
Hello,

I have a little problem with SQL statement to get values from a table.
Given a table:

Name  Val1 Val2 Val2
Smith     0      1     0
Smith     1      0     0
Smith     0      0     1
Roberts  1      0     0
Roberts  0      0     1

I need to get:
Name  Val1 Val2 Val2
Smith    1      1     1
Roberts 1      0     1


Best regards


pgsql-novice by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: modifying the source code
Next
From: Lukasz Brodziak
Date:
Subject: Re: Pivot table without crosstab