I'm working on a jasper report which takes one parameter based on which it should have a different where clause. Below is the query I'm using but seems there's a syntax error somewhere.
select customer.name
customer_order.name
from customer, customer
where customer.orders > 0
and customer_order.customer_id = customer.id
and customer_order.name in
(
case when (<paramter> = 1) then ('order1', 'order2')
else (select order_name from customer_order)
end
);
I appreciate any help, thanks