Hello, I'm trying to do a simple OQL query with a case expression. I follow this tutorial : https://world.mendix.com/display/refguide3/OQL+Case+Expression Unfortunately, I have always an error when I launch my query. Could I have a simple and concrete example of an OQL query using a case ? This is an example of what I tried : CASE SELECT Person WHEN 1 THEN 'one' ELSE 'two' Best regards.
The CASE statement should fit where a column does in an OQL query. If your basic query looks like this:
The output from this might look like:
If you replaced your selection of the Name attribute with a CASE statement, it would look like this:
SELECT CASE Name WHEN 'John' THEN 1 ELSE 0