那可以在前端控制的啊
if Paramet is null then
Select * From Table where STR is null;
else
sql="Select * From Table where STR='"+@Paramet+"'"
end if;

解决方案 »

  1.   

    可以用nvl函数试一下,不过不存在时,不能返回空值,可以返回空字符串
    Select * From Table where nvl(STR,' ')=' ';也可以返回符合条件的值
      

  2.   

    也可以在字段与参数两边都使用nvl函数,如:
    select * from table where nvl(str,'str字段不可能的值')=nvl(paramet,'str字段不可能的值')
      

  3.   

    谢谢大家的支持:
    我现在采用的方法是
    select * from table where str||'|'=paramet||'|' 
    来解决