help yourself by helping others - Mailing list pgsql-sql

From Ali Adams
Subject help yourself by helping others
Date
Msg-id 001c01c2fa9b$5b91ec80$03000000@DELLPC
Whole thread Raw
Responses Re: help yourself by helping others  (Richard Huxton <dev@archonet.com>)
Re: help yourself by helping others  ("scott.marlowe" <scott.marlowe@ihs.com>)
Re: help yourself by helping others  (Yasir Malik <ymalik@cs.stevens-tech.edu>)
Re: help yourself by helping others  (Jonathan Gardner <jgardner@jonathangardner.net>)
Re: help yourself by helping others  (Michael A Nachbaur <mike@nachbaur.com>)
Re: help yourself by helping others  (Rod Taylor <rbt@rbt.ca>)
Re: help yourself by helping others  (Rajesh Kumar Mallah <mallah@trade-india.com>)
List pgsql-sql
Dear All,
 
I am new to Relational Databases and SQL and my background in ODBs is clouding my way to solving what seems to be a simple problem. I am sure many of you have met it many times.
 
OK, I have a table as follows:
 
 
ID Machine   Date             Withdrawals
1  1              01/01/2003    1101
2  2              01/01/2003    2101
3  3              01/01/2003    3101
 
4  1              02/01/2003    1102
5  2              02/01/2003    2102
 
6  1              03/01/2003    1103
7  3              03/01/2003    3103
 
8  2              04/01/2003    2104
9  4              04/01/2003    4104
 
And i would like to create a monthly withdrawals report as follows:
 
Machine   Day1  Day2  Day3  Day4 .............................................. Day31
1             11      12      13       0                                                      0
2             21      22      0        24                                                     0
3             31      0        33       0                                                      0
4              0        0       0         0                                                     0
 
Can you please help?
 
Many thanks in advance.
 
Ali
<help yourself by helping others>
 

pgsql-sql by date:

Previous
From: Yasir Malik
Date:
Subject: Re: Datatype conversion help
Next
From: mila boldareva
Date:
Subject: Re: create view error