var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Case, Subquery, Greater than Comparison
Is it possible to have a subquery within a case statement and perform greater than / less than comparisons on the value returned in the subquery?
Sorry for the for example, but you get the idea?
select case (select price from product)
when < 100 then 'cheap'
when between 101 and 150 then 'fairly expensive'
Last edited by NickJ; 06-20-09 at 06:45.
when price < 100 then 'cheap'
when price < 150 then 'fairly expensive'
No, the input expression for the case statement needs to come from a subquery.
So the following would work...
... but wanted to do this withouth having repeat the subquery each time.
when (select price from product) < 100 then 'cheap'
when (select price from product) < 150 then 'fairly expensive'
Originally Posted by NickJ
Can you show us the whole picture?