select b.*from t_data_item b
where b.item_name like '%测试压力%'
and
(
(b.ct<to_date('2009-04-01 00:00:00','yyyy-mm-dd hh24:mi:ss') 
and b.dt>to_date('2009-03-01 00:00:00','yyyy-mm-dd hh24:mi:ss')) 
or (b.ct is null and b.dt is null)
)这个sql语句在仅当b.dt和b.ct其中一个为null的情况下会出现逻辑错误
我现在希望改成这样:
select b.*from t_data_item b
where b.item_name like '%测试压力%'
--如果b.ct不为null,则添加
and b.ct<to_date('2009-04-01 00:00:00','yyyy-mm-dd hh24:mi:ss')
--如果b.dt不为null,则添加
and b.dt>to_date('2009-03-01 00:00:00','yyyy-mm-dd hh24:mi:ss')该如何写?