mysq 存储过程判断为空null , mysql存储过程 字符串拼接

mysq 存储过程判断为空null , mysql存储过程 字符串拼接,mysq 存储过程判断为空null , mysql存储过程 字符串拼接,mysq 存储过程判断为空null , mysql存储过程 字符串拼接.

mysq 存储过程判断为空null 方法:

if i_os_type='' then
      set os_type_sql=CONCAT('=','');
   elseif i_os_type is null then
      set os_type_sql=' is null';
   else
      set os_type_sql=CONCAT('=',i_os_type);
   end if;

mysql存储过程 字符串拼接方法:

DECLARE  os_type_sql VARCHAR(100);

 if i_os_type='' then
      set os_type_sql=CONCAT('=','');
   elseif i_os_type is null then
      set os_type_sql=' is null';
   else
      set os_type_sql=CONCAT('=',i_os_type);
   end if;

猜你喜欢

转载自tompig.iteye.com/blog/1568213