select * from table where A ='B';
select * from table where 1=1;
将上面两条SQL语句合成一条,当B有值是A='B'条件有用,当B没有值是条件不起作用。
------解决方案--------------------
- SQL code
SELECT column1, column2 FROM table t WHERE t.TIME BETWEEN NVL (TO_DATE (parameter1, 'yyyy-mm-dd hh24:mi:ss'), t.TIME ) AND NVL (TO_DATE (parameter2, 'yyyy-mm-dd hh24:mi:ss'), t.TIME )