Subject Case statements in where clause
Author Nigel Weeks
Does anyone know of/have any examples of using case statements in the where
clauses of Select queries?
I'm wanting to run different types of selects depending on nulls, and i'd
rather on doing if blocks and multiple queries, as there'd be 2^n
combinations of searches...
If a parameter is not null, then it is used in the search, otherwise, any
value of the field is returned...possible?

select int_id, str_name, str_address
from table
(case when int_id id is not null then
int_id = :int_id /* Apply the provided filter */
1 /* I think this makes the condition true, and lets the record
match... */
(case when str_name is not null then
str_name = :str_name

What version of Firebird were they introduced in?

Nigel Weeks
15 Wellington St. Launceston Tas 7250
Ph. 61 3 6334 6664
Fax. 61 3 6331 7032
Email. nigel@...