oracle sql 怎么比较number类型大小?

2025-04-01 08:03:54
推荐回答(2个)
回答1:

number类型的话,可以直接比较

用法一:
select * form tablename where id>5 and id<10;
解释:这样就可以取出数字“id”在5到10之间的所有记录(不包含5和10)。
用法二:
select * from tablename where id between 5 and 10;

解释:这样就可以取出数字“id”在5到10之间的所有记录(包含5和10)。
用法三:
select t1. * from tablename1 t1 , tablename2 t2 where t1.id=t2.id;

解释:这样就可以取出所有的表1和表2中id值相同的表1的所有内容(注意,此用法只能条件等于,不能大于或小于(大于小于都是无意义的),)。

回答2:

number类型啊,就是数字,长度是38
在oracle中number类型可以用来存储0,正负定点或者浮点数,可表示的数据范围在
1.0
*
10(-130)
——
9.9...9
*
10(125)
{38个9后边带88个0}
的数字,当oracle中的数学表达式的值>=1.0*10(126)时,oracle就会报错。