直接看例子,判断为空是is null


delimiter //
create procedure proc__pre_activity_scan()
begin 
  declare p_tid int(10);
   set @p_tid=(select tid from hac_actity limit 0,1);
  if(@p_tid is not null) then
     select * from pre_forum_activity where tid=p_tid;
  end if;
end;
//
delimiter ;





Logo

更多推荐