1、mysql/procedure/ target=_blank class=infotextkey>mysql存储过程:
 
drop procedure if exists temp;
delimiter //
create procedure temp ()
begin 
    declare v_retur int;
    begin
    if exists(select 1 from dual where 1=1) then
            if 1=1 then
            set v_retur = 1;
        select v_retur;
            end if;
     end if;
    end;
end//
//exec
call temp();
2、mysql函数:
 
drop function if exists  hello ;
delimiter //
create function hello (s char(20)) 
returns char(50)
begin 
return concat('hello, ',s,'!');
end//
//exec
select hello('admin');