mysql存储过程判断不为空和不为空,查询结果赋值变量
直接看例子delimiter //create procedure proc__pre_activity_scan()begindeclare p_tid int(10);set @p_tid=(select tid from hac_actity limit 0,1);if(@p_tid is not null) thenselect * from p
·
直接看例子,判断为空是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 ;
更多推荐
已为社区贡献1条内容
所有评论(0)