where rownum = 1
                 
                 and in_Spnumber LIKE  spms_spnum_info_t.f_SpNumber||'%'
                 and spms_spnum_info_t.f_service_type = in_ServiceType
                 and spm_sp_info_t.f_sp_id = spms_spnum_info_t.f_sp_id
只列了条件里的一部分,手头没有书,也没有学过,这个条件是什么意思
前面是SELECT,后面还有很很多的and,太长了,不写了。in_Spnumber是存储过程外面输入的变量。

解决方案 »

  1.   

    如果select后有很多条记录的话,则只取查出来的第一条记录.
      

  2.   

    简单对门外汉也是不会滴in_Spnumber LIKE  spms_spnum_info_t.f_SpNumber||'%'
    这句
      

  3.   


    --略作分析:select *
      from tab
     where rownum = 1                                                --Oracle内部记录号为1
       and in_Spnumber LIKE spms_spnum_info_t.f_SpNumber || '%'      --相当于 v_1 like 'abc%'
       and spms_spnum_info_t.f_service_type = in_ServiceType         --spms_spnum_info_t可能是表名,f_service_type为前者中的字段
       and spm_sp_info_t.f_sp_id = spms_spnum_info_t.f_sp_id;        --同上
      

  4.   

     and in_Spnumber LIKE spms_spnum_info_t.f_SpNumber || '%'      --相当于 v_1 like 'abc%'说的都 对,上面那句能不能说的细点,我只知道是模糊查找
      

  5.   

    意思是不是
    in_Spnumber就是 v_1
    spms_spnum_info_t.f_SpNumber就是你说的abc
    呵呵
      

  6.   

    in_Spnumber 为abcdsdff
    spms_spnum_info_t.f_SpNumber 为abcd
    那么abcdsdff=abcd%
      

  7.   

    % 为oracle通配符  可以匹配 0到n个字符
    _ 只可以匹配一个字符