I love the CASE statement, but yah I think its a cleaner in a view (also what DB's support this one ?  let me guess, PG and Oracle and thats it....oh and MSSQL-9.nobodyhasit :)  ).   You can use literal strings too for this kind of thing.

if you have some brilliant notion of how this would even look as Python expressions, that would be interesting to see.  It would definitely live as a plugged-in extension.  I should make an effort to formally define the "extensions" idea I have so that people can contribute whatever plugins they want.

On Mar 17, 2006, at 12:20 PM, Jonathan Ellis wrote:

I would think that the "right thing" to do here would be to map a view containing your case, instead of kludging this into the mapper code.

On 3/17/06, Rick Morrision <[EMAIL PROTECTED]> wrote:
Hey Mike -- are there any plans for support for the CASE construct as a column type? Is anyone else interested in this?

CASE WHEN [condition] THEN [result]
       [WHEN ...]
       [ELSE result]
END

--
Jonathan Ellis
http://spyced.blogspot.com

Reply via email to