Subject Re: Is it possible to do this query?
Author Adam
--- In firebird-support@yahoogroups.com, "Anthony Tanas" <anthony@...>
wrote:
>
> Is it possible to perform a select where the data rows returned are
> different fields from different tables?
>
> I want to do like a transaction activity report that would have data
from
> two tables - a billing table and a payment table.
>
> So I'll slightly simplify my situation in this example:
>
> BILLING
> ---------
> BILLINGID
> BILLINGDATE
> BILLINGCODE
> BILLINGAMOUNT
>
> PAYMENT
> --------
> PAYMENTID
> PAYMENTDATE
> PAYMENTCODE
> PAYMENTAMOUNT
>
> So I'd like results something like:
>
> BILL1,JAN1,BILLCODE1,100
> PAY1,JAN2,PAYCODE1,50
> PAY2,JAN3,PAYCODE1,50
> BILL2,FEB1,BILLCODE1,100
> PAY3,FEB2,PAYCODE1,50
>
> And so forth...is such a thing possible?
>

Sounds very much to me that you are after a 'UNION' (google for syntax)

Adam