trans mb to kb
select softSize,concat(substring(softSize,1,locate('mb',softSize)-1)*1024,'.00') from soft where softSize like '%mb%'



select softSize,substring(softSize,1,locate('kb',softSize)-1) from soft where softSize like '%kb%'


CREATE DEFINER=`root`@`localhost` FUNCTION `getKbStr`(`p_soft_size` varchar(30)) RETURNS varchar(30) CHARSET utf8
BEGIN
#Routine body goes here...
if locate('kb',p_soft_size)>0  then
return substring(p_soft_size,1,locate('kb',p_soft_size)-1);
        end if;

if locate('mb',p_soft_size)>0  then
return substring(p_soft_size,1,locate('mb',p_soft_size)-1)*1024;
        end if;

        return 0;

END
lunzi   2010-07-18 15:04:52 评论:0   阅读:199   引用:0

发表评论>>

署名发表(评论可管理,不必输入下面的姓名)

姓名:

主题:

内容: 最少15个,最长1000个字符

验证码: (如不清楚,请刷新)

Copyright@2004-2010 powered by YuLog