On Tue, Mar 16, 1999 at 09:56:47AM -0500, skip@stripped wrote:
> select venue.name, locale.city, locale.state
> from venue, address, locale
> where (venue.address = address.id)
> and (address.locale = locale.id)
> and (venue.phone = 0)
> UNION
> select venue.name, locale.city, locale.state, phone.voice
> from venue, address, locale, phone
> where (venue.address = address.id)
> and (address.locale = locale.id)
> and (venue.phone != 0)
> and (venue.phone = phone.id)
> ;
I think this is right:
SELECT venue.name, locale.city, locale.state, phone.voice
FROM venue
, address
, locale
LEFT JOIN phone ON (venue.phone = phone.id)
WHERE venue.address = address.id
AND address.locale = locale.id
The phone.voice field will be NULL for any venues that do not
have a matching phone id.
Tim