我正在處理一個基於它應該有一個不同的where子句的基於一個參數的jasper報告。下面是我正在使用的查詢,但似乎有某處的語法錯誤。在where子句中有另一個sql語句的情況條件
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
);
我感謝所有幫助, 感謝