Querying multiple tables - Mailing list pgsql-novice

From Paul Malherbe
Subject Querying multiple tables
Date
Msg-id 46B07DB4.4070406@tartan.co.za
Whole thread Raw
Responses Re: Querying multiple tables
List pgsql-novice
Hi

I have 4 tables:

1) Owner Table - rcaowm - having own_code, owm_name
2) Tenant Table - rcatnm - having tnm_code (owner's code), tnm_acno
(tenant's account number), tnm_name
3) Owner Transactions - rcaowt - having owt_code (owner's code),
owt_date, owt_value
4) Tenant Transactions - rcatnt - having tnt_code (owner's code),
tnt_acno (tenant's account number), tnt_date, tnt_value

I want to produced a query giving the following data:

Owner_Name, Tenant_Name, Sum_Owner_Transaction_Value,
Sum_Tenant_Transaction_Value

Is there any way this can be achieved with a single select statement??

Thanks

Paul

pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: SQL_CALC_FOUND_ROWS equivalent in PostgreSQL
Next
From: Michael Glaesemann
Date:
Subject: Re: Querying multiple tables