Summary of Oracle's most basic cainiao

Source: Internet
Author: User

1. When multiple tables are combined, an error "Character Set mismatch" is returned when the nvarchar2 type is encountered"

A: Add to_char (variable or field of nvarchar) to the place where nvarchar is used)

2. When multiple tables are union, the order by statement is incorrect. just delete the order by statement.

A: Oracle only supports the use of order by in the last SELECT statement. If there is only one order by statement, place it in the last sentence. If there are multiple order by statements, think about other statements.
3. nvl () nvl2 () Usage

Nvl (expr1, expr2)-> If expr1 is null, return the value of expr2; if not, return expr1's own value;

Notice: the type of expr1 and expr2 are same!

Nvl2 (expr1, expr2, expr3)-> If expr1 is not null, return the value of expr2; If null, return expr3's own value;

Nullif (expr1, expr2)-> equal return NULL, not equal return expr1

4. If else statement

Sqlserver:

If () begin... end else begin... end

ORACLE:

If... then .... end if; or if ..... then .... else .... end if; or if .... then ..... elsif... then .... end if; if... elsif... elsif .... end if;

5. Output messages

Sqlserser: Print ('') Oracle: dbms_output.putline ('')

6. String concatenation

Select 'funding scheduler-'| to_char (seq_emp.nextval, '123 ')

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.