데이터베이스/CUBRID FAQ

CUBRID cast 주의 사항

쌀맛나는세상 2010. 1. 14. 17:01

create table test_num ( var1 numeric(10,3) ) ;

insert into test_num ( var1 ) values ( 10.12);

select var1 + 1 from test_num

select var1 + 10.2 from test_num

select var1 + cast ( to_number('10.23','00.00') as numeric(10,4) ) from test_num

select to_number('10.23','00.000') from db_root

create table test_data1 ( var1 numeric(10,0) , var2 integer );

insert into test_data1 ( var1, var2 ) values ( 10 , 10)

select sysdate + cast(var1 as int)  from test_data1

select sysdate + var1 from test_data1

select sysdate + var2 from test_data1

select sysdate + cast ( to_number(1.1,'0.0') as int ) from db_root