Re: Query problem - Mailing list pgsql-general

From JAMES
Subject Re: Query problem
Date
Msg-id 90o5t0$qct4@imsp212.netvigator.com
Whole thread Raw
In response to Query problem  ("JAMES" <harleyip@hotmail.com>)
List pgsql-general
I can't get the expected result.
Actually, I have 5 tables,
I am going to find out current stock quantity of each item for current day,
sysdate.
Thanks!
James

invoice
invoice_no     staff_name     trans_date
01                  Lancy Lam     23-DEC-00
02                  Tim Hon         02-DEC-00
03                  Jack Wong     11-DEC-00

trans
invoice_no     item_id     qty
01                 P001         1
01                 P002         5
01                 P033         2
01                 P034         1
02                 P022         4
02                 P034         3
02                 P301         1
03                 P001         1

item
item_id     item_name                         cost     selling_price
P001         Unix Training Package     1000     1200
P002         Unix Guide                       100       200
P022         Let us go Europe               100      400
P033         Europe Travel Route         10        100
P034         Europe travel Video Tape 200      300
P301         Unix Installation CD         500     1000

package
package_id     sub_item_id
P001             P002
P001             P301
P022             P033
P022             P034


stock_in
item_id         trans_date             qty
P001             02-JAN-00         15
P002             01-DEC-00         50
P022             05-MAY-00         70
P033             25-SEP-00         50
P034             01-MAY-00         40
P301             12-DEC-99         30
P001             20-DEC-00         10
P034             21-DEC-00         5
P002             17-DEC-00         10




pgsql-general by date:

Previous
From: Franck Martin
Date:
Subject: RE: Problems with Mandrake RPM
Next
From: Zeljko Trogrlic
Date:
Subject: Re: Re: Re: Why PostgreSQL is not that popular as MySQL ?