Subject | Re: [ib-support] How to join results of two queries. |
---|---|
Author | hans |
Post date | 2003-01-06T05:14:08Z |
I think you may want to use a 'union' instead of a join
-------------------------------------------------------
-------------------------------------------------------
----- Original Message -----
From: "Neil Murby" <neil.murby@...>
To: "<" <ib-support@yahoogroups.com>
Sent: Sunday, January 05, 2003 9:09 PM
Subject: [ib-support] How to join results of two queries.
> Hi,
>
> In my application I have clients and staff, both on the same mailing
> list.
>
> I select the staff like this:
> select staff.staffid as id, staff.lastname as name, 'staff' as
> recordtype
> from staff right join liststaff on staff.staffid = liststaff.staffid
> where liststaff.ListID = :ListID
>
> and I select the contacts in a similar fashion
> select contact.contactid as id, contact.lastname as name, 'contact' as
> recordtype
> from contact right join listcontacts on contact.contactid =
> listcontacts.contactid
> where listcontacts.ListID = :ListID
>
> What I'd like to be able to do is somehow create a query like this:
> select recordtype, id, name
> from <staff query> full join <contact query>
> order by name
>
> I haven't been able to figure out a way to do this, is there one?
>
> Any help would be greatly appreciated.
> Thanks,
> Neil.
>
> BTW I'm using IB 6.5 on Linux (RH 8.0)
>
>
>
> IMPORTANT -
> (1) The contents of this e.mail and its attachments are confidential and
privileged. Any unauthorised use of the contents is expressly prohibited.
If you receive this e.mail in error, please contact us, then delete the
e.mail.
> (2) Before opening or using attachments, check them for viruses and
defects. The contents of this e.mail and its attachments may become
scrambled, truncated or altered in transmission. Please notify us of any
anomalies.
> (3) Our liability is limited to resupplying the e.mail and attached files
or the cost of having them resupplied.
> (4) Minter Ellison collects personal information to provide and market our
services. For more information about use, disclosure and access see our
privacy policy at www.minterellison.com.
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>