select * from yourtable where (para='' OR hh=para)

解决方案 »

  1.   

    bh的类型为number.
    select * from yourtable where (para='' OR bh = to_number(para))
      

  2.   

    还是过程比较容易实现if para is null then
    select * from yourtable;
    else
    select * from yourtable where bh =para;
    end if;
      

  3.   

    SELECT * FROM TABLE_NAME WHERE PARA='' OR BH='PARA';
      

  4.   

    if para is null then
    select * from yourtable;
    else
    select * from yourtable where bh =para;
    end if;
      

  5.   

    楼上上SQL语句可以吗?
    不会提示表中无此字段吧??