Sorry for the ambiguity, I was trying to make a really generic select
statement.  I just meant that if 'where a = A.a' has no matches, but 'where
b = B.b' or 'where c = C.c' does match, the query returns what did match,
and just returns null where it didnt.  I will look at the CASE WHEN...THEN.

Thanks!
 

-----Original Message-----
From: Jason Landry [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 12:00 PM
To: Bryan Coon; [EMAIL PROTECTED]
Subject: Re: Small select question...


You'll have to be more specific in your example -- your select statement
below is rather ambiguous.

However, take a look at the CASE WHEN...THEN functions that MySQL offers.
I'm sure it's exactly what you are looking for.


----- Original Message -----
From: "Bryan Coon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 20, 2001 1:30 PM
Subject: Small select question...


> Hopefully this is not too lame a question...
>
> In oracle, I can do this:
>
> select a, b, c from A, B, C where a = A.a (+) and b = B.b (+) and c = C.c;
>
> What is the equivalent in MySQL?  The (+) allows that 'where' statement to
> be kind of optional (I think). Basically I want to do a select on multiple
> tables and if one of the 'where' statements doesn't match anything, the
> query still returns values for other statements that did (e.g. if a = A.a
is
> not true, but b = B.b is, I want to return B.b).
>
> Thanks!
>
> ---------------------------------------------------------------------
> 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
>

---------------------------------------------------------------------
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

Reply via email to