Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Oracle () trunc function usage     - Java object serialization and deserialization (Programming)

- Linux environment MySQL master-slave synchronization (Database)

- Java interface (Programming)

- To build a private Docker registry (Server)

- Binary tree traversal recursive and non-recursive (cyclic) traversal achieve (Programming)

- DataGuard the MRP can not start to analyze and solve problems (Database)

- Oracle 11g to create a second instance on Linux (Database)

- MySQL Installation Troubleshooting (Database)

- Shutdown - an advanced shutdown artifact (Linux)

- PHP 7.0 Upgrade Notes (Linux)

- Getting jQuery - progress bar (Programming)

- To install and deploy PHP environment under the CentOS (Server)

- Ubuntu install OpenMPI (Linux)

- CentOS7 virtual machine creation failed Solution (Linux)

- Package the Python script file into an executable file (Programming)

- Java, hashcode, equals and == (Programming)

- The callback function used in C ++ (Programming)

- Zorin OS: Linux novice most personal desktop system should be used (Linux)

- Java, on the dfile.encoding Systemproperty (Programming)

- Linux file system management partition, format, mount - label mount (Linux)

 
         
  Oracle () trunc function usage
     
  Add Date : 2018-11-21      
         
         
         
  - Oracle trunc () function usage
/ ************** date TRUNC () function does not have seconds precision ******************** /


Select sysdate from dual - the date

Select trunc (sysdate) from dual

Select trunc (sysdate, 'DD') from dual - today's date

Select trunc (sysdate, 'd') + 7 from dual - this Sunday

Select trunc (sysdate, 'dy') + 7 from dual - Sunday this week

Select trunc (sysdate, 'day') + 7 from dual - This Sunday

Select trunc (sysdate, 'q') from dual - this season start date

Select trunc (sysdate, 'month') from dual - This month's start date

Select trunc (sysdate, 'mm') from dual - This month's start date

Select trunc (sysdate, 'year') from dual - This year's start date

Select trunc (sysdate, 'yyyy') from dual - This year's start date

Select trunc (sysdate, 'HH24') from dual - This hour starts

Select trunc (sysdate, 'MI') from dual - The minutes start time

Select trunc (sysdate, 'CC') from dual - the beginning of the century

Select trunc (LAST_DAY (sysdate), 'dd') from dual - the last day of the month

 


The round (10.2356, 2) function rounds the number by a specified number of reserved decimal places, which also rounds the date


Select round (sysdate, 'yyyy') from dual rounded to year

Select round (sysdate, 'mm') from dual rounded to month

Select round (sysdate, 'dd') from dual rounded to the date

Select round (sysdate, 'hh') from dual rounded to hours

Select round (sysdate, 'mi') from dual rounded to minutes

 

/***************digital********************/
/ *
TRUNC (number, num_digits)
Number A truncated number.
Num_digits Numbers used to specify the rounding precision. The default value for Num_digits is 0.
The TRUNC () function is not truncated when truncated
* /
Select trunc (123.458) from dual --123
Select trunc (123.458,0) from dual --123
Select trunc (123.458,1) from dual --123.4
Select trunc (123.458, -1) from dual --120
Select trunc (123.458, -4) from dual --0
Select trunc (123.458,4) from dual --123.458
Select trunc (123) from dual --123
Select trunc (123,1) from dual --123
Select trunc (123, -1) from dual --120
     
         
         
         
  More:      
 
- C language print various graphic (Programming)
- Deb package installation method under ubuntu (Linux)
- Recover Ubuntu 14.04 wakes up from standby in case mouse keyboard appears dead (Linux)
- CentOS / RHEL 6 was repeated prohibited under the SNMP connection log (Server)
- Linux common network tools: hping Advanced Host Scan (Linux)
- Root of AVL Tree- achieve balanced search trees AVL tree (Programming)
- How to deploy Icinga client (Server)
- Python in os.path Magical (Programming)
- Git remote repository Explanation (Linux)
- Log4j configuration file Explanation (Linux)
- Proxmox VE implement KVM OpenVZ virtualization cloud computing (Server)
- Three kinds of implementation model of the Linux thread history (Programming)
- C / C ++ language variable scope: local variables, global variables, file-level variables (Programming)
- ORA-04091 and Compound Trigger (Oracle 11g) (Database)
- CentOS 6.4 RPM install MySQL-5.6.22-1 (Database)
- Git version rollback (Linux)
- CentOS 6.5 configuration SSDB 1.8.0 (Server)
- About the replication of JavaScript (Programming)
- The Concept and Semantics of Java Memory Model (Programming)
- Android Qemu GPS module (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.