Sign-up....

如何判断变量是否是"123"结尾?

变量 countnum

如何判断变量是否是以"123"结尾的呢?

countnum的值可能是个位数.

[52 byte] By [msdn] at [2007-11-17 11:06:05]
# 1 Re: 如何判断变量是否是"123"结尾?

substr(countnum,length(countnum)-2,lentgh(countnum)=123;

znbalan at 2005-5-13 18:02:17 >
# 2 Re: 如何判断变量是否是"123"结尾?

IF substr(countnum,-3) = 123 THEN

ELSE

END IF;

skystar99047 at 2005-5-13 19:08:12 >
# 3 Re: 如何判断变量是否是"123"结尾?

-- Created on 2005-5-14 by XACB

declare

-- Local variables here

i integer;

s varchar2(200);

begin

s :='asd123';

-- Test statements here

if(s like '%123') then

dbms_output.put_line('OK');

end if;

end;

newboy3205579 at 2005-5-14 0:38:19 >
# 4 Re: 如何判断变量是否是"123"结尾?

第一位朋友的差一点,经过修改可以使用

第二位朋友的直接可以使用,且简单

第三位朋友的有些问题

谢谢大家!

hxiaoming at 2005-5-14 9:32:10 >

Oracle

All Classified