1. A computer-implemented method for executing a query in a computer to retrieve data from a relational database stored on a data storage device, the method comprising: receiving a query containing a CASE expression having one or more subqueries; generating a query execution plan, the query execution plan using a parameterized union all operator to keep the semantics of the CASE expression, and a nested loop join operator to drive data across the section of the query execution plan that executes the CASE expression, wherein, when all logical expressions in the CASE expression are simple expressions, a single parameterized union all operator with one branch per action in the CASE expression is used and the nested loop join operator provides data to the parameterized union all operator which executes the CASE expression; and executing the generated query execution plan in the computer to retrieve data from the relational database.