Summary of Oracle and SQL comparison syntax

Source: Internet
Author: User

SQL database Oracle Database


Isnull (field name, replace value) ------------------------------------------------------------- nvl (field name, replace value)


Substring (field name, start position, cut length) ------------------------------------------ substr (field name, start position, cut length)


Getdate () ------------------------------------------------------------------------------- select sysdate from dual


Year (getdate () ----------------------------------------------------------------- select to_char (sysdate, 'yyyy') from dual


Month (getdate () ------------------------------------------------------------ select to_char (sysdate, 'mm') from dual


Day (getdate () ---------------------------------------------------------------- select to_char (sysdate, 'dd') from dual


Select datepart (hour, getdate () ---------------------------------- select to_char (sysdate, 'hh') from dual


Select datepart (minute, getdate () ----------------------------------- select to_char (sysdate, 'mi') from dual


Select datepart (second, getdate () -------------------------- select to_char (sysdate, 'ss') from dual


+ (Connection Symbol) -------------------------------------------------------------------------- |


'2017-03-29 11:40:28 '----------------------------------------------------------- to_date ('2017-03-29 11:40:28', 'yyyy/MM/dd hh: MI: ss ')

 

Uniqueidentifier extends sys_guid ()

 

Select sys_guid () from dual;

Create Table Test2
(
UUID varchar2 (200) default sys_guid (),
Uname varchar2 (20)
);

Insert into Test2 (uname) values ('hello ');

Insert into Test2 (uname) values ('World ');

Select * From Test2;

 


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.