有点难度的SQL语句
line_no
有什么方法把当line_no=-1时把查询条件忽略啊
select DEPT_NO,LINE_NO,BUS_NO,OP_NO,IS_UP_DOWN,START_TIME,START_LABEL_NO,END_TIME,END_LABEL_NO from tm_dri_single_distance where trim(line_no)=trim(:lineno) and is_up_down in (decode(:IsUpDown,0,0,1,1,-1,0),decode(:IsUpDown,0,0,1,1,-1,1)) and op_no =:opno and to_char (start_time,'yyyymmdd') >=to_char(:StartTime,'yyyymmdd') and to_char(end_time,'yyyymmdd')<=to_char(:EndTime,'yyyymmdd') order by op_no,START_TIME desc
也就是当
trim(line_no)=trim(-1
)