还有这个:
CREATE PROCEDURE proc_GetListenVoc (in V_pos int,   ----位置,初始置0
                                    in V_operid int,----业务id
                                    in V_type int,  ----类别
                                    in V_mode int   ----方式:1下条,2上条。          
                                    )
begin 
    DECLARE M_id int;
    DECLARE M_path varchar(50);    set M_id=0;
    if V_mode=2 THEN
        begin         
         select M_id=id ,M_path=path from base_listen where  operid=V_operid and typee=V_type and id<V_pos order by id desc limit 1 ;
         if M_id=0 THEN
         select M_id=id ,M_path= path from base_listen where operid=V_operid and typee=V_type and id<1000000 limit 1;
        end IF ;
        end ;
        else
        begin
         select M_id=id ,M_path=path from base_listen where  operid=V_operid and typee=V_type and id>V_pos order by id asc limit 1 ;
         if M_id=0 THEN
         select M_id=id ,M_path= path from base_listen where operid=V_operid and typee=V_type and id>0 limit 1;
            end IF ;
        end ;
    end if  ;  
    
    select M_id as pos ,M_path as path; 
end ;分数另开帖加100!!!!!!!!!!!