oracle cast 用法
来源:互联网 发布:seo在哪里可以自学 编辑:程序博客网 时间:2024/06/05 10:02
cast 是进行类型转换的, 可以针对各种Oracle数据类型. 修改的是用户的数据类型.
round只是修改的数据显示格式. 对数据做四舍五入. 类似的函数还有ceil(取此数据的最小整数). trunc( 取整函数.)
SQL> create table t1(a varchar(10));
Table created.
SQL> insert into t1 values ('12.3456');
1 row created.
SQL> select round(a) from t1;
ROUND(A)
----------
12
SQL> select round(a,3) from t1;
ROUND(A,3)
----------
12.346
SQL> select cast(a as int) from t1;
CAST(AASINT)
------------
12
SQL> select cast(a as number(8,4)) from t1;
CAST(AASNUMBER(8,4))
--------------------
12.3456
round只是修改的数据显示格式. 对数据做四舍五入. 类似的函数还有ceil(取此数据的最小整数). trunc( 取整函数.)
SQL> create table t1(a varchar(10));
Table created.
SQL> insert into t1 values ('12.3456');
1 row created.
SQL> select round(a) from t1;
ROUND(A)
----------
12
SQL> select round(a,3) from t1;
ROUND(A,3)
----------
12.346
SQL> select cast(a as int) from t1;
CAST(AASINT)
------------
12
SQL> select cast(a as number(8,4)) from t1;
CAST(AASNUMBER(8,4))
--------------------
12.3456
0 0
- oracle cast 用法
- oracle cast 用法
- oracle cast 用法
- oracle cast 用法
- oracle cast 的用法
- Oracle的Cast的用法
- cast 用法
- cast 用法
- ORACLE中时间类型的转换cast用法
- CAST 和 CONVERT 用法
- tf.cast用法
- 关于Cast<>的用法
- oracle cast() 函数问题
- oracle cast() 函数问题
- Oracle cast函数
- oracle 转型 cast
- oracle函数-cast
- cast 和convert用法详解
- 题目21:包含min()方法的栈
- 当我在写程序的时候,我究竟在写些什么?
- Linux下多路复用式串口操作
- 盘古越狱工具 v1.1 官方免费版
- sgu139Help Needed!判断15数码是否有解,以及判断N数码是否有解的推论
- oracle cast 用法
- ios学习之用xcode写简单的HelloWorld控制台程序
- Xcode5.x编译64位应用时的出错问题
- linux man 手册中的下划线字段
- hadoop搭建好后出现的format异常
- perl控制流介绍(if条件,while,for循环,foreach)
- B-Tree(Balance Tree)的Java实现
- String.split("","")与StringUtil.split("","")的区别
- 静态变量与实例变量区别