Hi,
I have an employee table with CNIC# column. if pass dummy parameter in query as 'YES', query find those records having cnic# (cnic# is not null), and if parameter pass with 'NO' then query should find those records that have no cnic# (cnic# is null). if don't pass any parameter then all records should be viewed .
I tried with decode function but I think it don't support the "not null". such as
select emp_id,emp_name,emp_cnic
from employee_view a
where emp_cnic =decode(:p_cnic,'YES',emp_cnis is not null,'NO',emp_cnic is null,emp_cnic)
Oracle 11gR1
Many thanks for the provision of any opinion
Regards.