CREATE FUNCTION isRepeat1(mycode varchar(32)) RETURNS varchar(32)
DETERMINISTIC
COMMENT 'I_Code中index是否重复,0不重复,1 重复'
begin
declare i varchar(32);
set i = (select count(*) from gqj_gqjbook where substring(I_CODE,6,18) = substring(mycode,6,18));
if i = 1 then
set i = 0;
else
set i = 1;
end if;
return i;
end
mysql 自定义函数,if else
最新推荐文章于 2024-07-06 02:41:31 发布