MySQL Forums
Forum List  »  General

Returned two values from a case statement?
Posted by: Brent Bigler
Date: December 22, 2005 07:37PM

I'm trying to write a select statement that looks something like this:

select * from table where tablefield in (0, 8)

The "0, 8" needs to be generated within the SQL by reference to another field in the table. I had hoped something like this would work:

select * from table where tablefield in (case otherfield when 1 then (0, 8) else 3)

... but -- of course -- it fails.

Does anyone have any suggestions on how to derive this value?

Thanks for any help.

-- Brent

Options: ReplyQuote


Subject
Written By
Posted
Returned two values from a case statement?
December 22, 2005 07:37PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.