Oracle/PLSQL: Trunc Function (with dates):
http://www.techonthenet.com/oracle/functions/trunc_date.php
引用
In Oracle/PLSQL, the trunc function returns a date truncated to a specific unit of measure.
The syntax for the trunc function is:
trunc ( date, [ format ] )
date is the date to truncate.
format is the unit of measure to apply for truncating. If the format parameter is omitted, the trunc function will truncate the date to the day value, so that any hours, minutes, or seconds will be truncated off.
Below are the valid format parameters:
Applies To:
Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
For example:
trunc(to_date('22-AUG-03'), 'YEAR') would return '01-JAN-03'
trunc(to_date('22-AUG-03'), 'Q') would return '01-JUL-03'
trunc(to_date('22-AUG-03'), 'MONTH') would return '01-AUG-03'
trunc(to_date('22-AUG-03'), 'DDD') would return '22-AUG-03'
trunc(to_date('22-AUG-03'), 'DAY') would return '17-AUG-03'
Oracle/PLSQL: Trunc Function (with numbers):
http://www.techonthenet.com/oracle/functions/trunc_nbr.php
引用
In Oracle/PLSQL, the trunc function returns a number truncated to a certain number of decimal places.
The syntax for the trunc function is:
trunc( number, [ decimal_places ] )
number is the number to truncate.
decimal_places is the number of decimal places to truncate to. This value must be an integer. If this parameter is omitted, the trunc function will truncate the number to 0 decimal places.
Applies To:
Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
For example:
trunc(125.815) would return 125
trunc(125.815, 0) would return 125
trunc(125.815, 1) would return 125.8
trunc(125.815, 2) would return 125.81
trunc(125.815, 3) would return 125.815
trunc(-125.815, 2) would return -125.81
trunc(125.815, -1) would return 120
trunc(125.815, -2) would return 100
trunc(125.815, -3) would return 0

- 大小: 6.4 KB
分享到:
相关推荐
总的来说,"oracle/plsql developer 联合安装软件"为开发者提供了一个完整的解决方案,方便他们进行Oracle数据库的开发和管理工作。通过优化的安装流程和正确的配置,可以确保这两个工具无缝协同工作,大大提高工作...
Oracle PL/SQL教程全解是一份全面覆盖Oracle数据库和PL/SQL编程的资源,适合对数据库技术感兴趣的初学者和进阶者。Oracle是全球广泛使用的数据库管理系统,而PL/SQL则是Oracle特有的结构化查询语言,用于编写存储...
Oracle镜像文件太大! 可分两步创建Oracle镜像: 1、创建Oracle基础镜像, 创建基础镜像时需要下载很多依赖包。可直接拉取:docker pull estc/base:v1.0 2、根据基础镜像和Oralce安装包, 没有网络环境也能快速创建...
标题中的“不安装oracle使用plsql”意味着要在没有Oracle数据库客户端的情况下使用PL/SQL Developer这一工具。这通常通过Oracle的Instant Client实现,该组件提供了一种轻量级的解决方案,允许用户连接到Oracle...
Oracle9i SQL/PLSQL 学习笔记 自己照着书学习时候的笔记。TXT的,比较简单,希望对大家学习有帮助。 其中0 mysqlCmd.txt是我自学mysql时候的笔记,是有关于命令的。大家看看有帮助没有。 都比较精华和简单,适合...
Oracle_plsql讲义:第11章 视图.ppt
《精通Oracle10g/PLSql编程》这本书深入浅出地介绍了Oracle数据库系统与PL/SQL编程语言,是初学者入门和进阶的宝贵资源。Oracle10g是Oracle数据库的一个重要版本,它提供了许多增强的功能和优化,使得数据管理更为...
PLSql 很好的一个控制数据库工具(ORACLE)
Oracle_plsql讲义:第10章 约束.ppt
PLSQL/PLSQL Developer V7.14 官方原版 汉化包 注册码
Oracle_plsql讲义:第5章 组函数和分组统计.ppt
Oracle_plsql讲义:第19章 复合数据类型.ppt
Oracle_plsql讲义:第21章 异常.ppt
Oracle_plsql讲义:第7章 替代变量和SQL-Plus环境.ppt
Oracle_plsql讲义:第6章 子查询.ppt
Oracle_plsql讲义:第18章 控制结构.ppt
Oracle_plsql讲义:第12章 其它数据库对象.ppt
Oracle_plsql讲义:第16章 可执行部分.ppt
Oracle_plsql讲义:第2章 限定查询和排序.ppt
log4oracle-plsql 框架是一组对象,用于帮助 PL/SQL 程序员将日志语句输出到各种输出目标。 log4oracle-plsql 基于 Apache log4j/log4net 框架。 它使使用特别是配置尽可能与 log4x 相似,以便为开发人员提供已知...