MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Robin Bowes Date:March 16 1999 3:19pm
Subject:RE: How do I work around lack of UNION i
View as plain text  
> I have a music venue database with several fairly obvious
> tables.  The venue
> table contains a foreign key that references into a phone
> table.  I don't
> always have phone information for a venue, however, so
> sometimes that key is
> 0.  I'd like to select (for example), the venue name, city,
> state and phone,
> but am having trouble figuring out how to work around the
> partial missing
> data.

Use a left-join.


      select,, locale.state
 	from venue
	join address on venue.address =
	join locale on address.locale =
	left join phone on =

(this is off the top of my head so the syntax my be slightly wrong)

Robin Bowes, System Development Manager, Equal Opportunities Commission,
Room 405A, Overseas House, Quay St., Manchester, M3 3HN, UK.
Tel: +44 (0) 161 838 8321  Fax: +44 (0) 161 835 1657

Lord, grant me the serenity to accept the things I cannot change,
the courage to change the things I can, and the wisdom to hide the
bodies of the people I had to kill because they pissed me off  - Anon.
RE: How do I work around lack of UNION iRobin Bowes16 Mar