Querying multiple tables

Поиск
Список
Период
Сортировка
От Paul Malherbe
Тема Querying multiple tables
Дата
Msg-id 46B07DB4.4070406@tartan.co.za
обсуждение исходный текст
Ответы Re: Querying multiple tables  (Michael Glaesemann <grzm@seespotcode.net>)
Список 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 по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: SQL_CALC_FOUND_ROWS equivalent in PostgreSQL
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: Querying multiple tables