On Thursday 30 August 2001 15:28, Andre Konopka wrote:
> Hi,
>
> I have, three tables (one,two, three) with the rows id/value. id is the
> key for all the tables.
>
>
> with
>
>
> select value from one where id=xx;
> select value from two where id=xx;
> select value from three where id=xx;
>
>
> I can select all values from the tables with the id=xx.
>
> How can I do this with one select statement. Notice, it's possible that
> there is an entry for id=xx in table one, but
> not in table two, or three. Of course ist's possible that there is only
> a value in table three.
>
> The output could be
>
> id one.value two.value three.value
> x1 233 2342 NULL
> x2 NULL 998 NULL
> x3 33 232 23
>
> Clear enough?
A couple of LEFT JOINs should probably do the trick
HTH
Ian Barwick
--
Ian Barwick - Developer - [EMAIL PROTECTED]
akademie.de asp GmbH - http://www.akademie.de
"To query tables in a MySQL database is more fun than eating spam"
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php