List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:October 3 1999 3:50pm
Subject:Re: case (if-then)
View as plain text  
On Sun, 1999-10-03 10:46:15 -0400, Saeed Teebi wrote:
> I need to make mysql check one field and then do one of two or 
> three things (basically SELECT stuff) depending on its contents.

Current versions of MySQL don't have sub-selects (as far as I know
it's planned for V3.24), so this isn't possible.

See chapter "5.3 Functionality missing from MySQL" of the MySQL
Reference Manual.

> I tried putting some select statements inside a CASE statement but
> that doesn't seem to work. Am I on the right track? Is there a way
> at all?

In chapter "7.3.8 Control flow functions" you'll find descriptions of
IFNULL, IF, and (for V3.23.x) CASE, but I don't think this will help
in your case, because you say you need "SELECT stuff".

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=5244 5EF3 B0B1 3826  E4EC 8058 7B31 3AD7
Thread
case (if-then)(Saeed Teebi)3 Oct
  • Re: case (if-then)Martin Ramsch3 Oct
  • Re: case (if-then)Tonu Samuel3 Oct