Some of the new tricks that were taught in class

Source: Internet
Author: User

exec dbms_mview.refresh (' mv_name ');



Union join function, there is the ability to automatically remove duplicate records, if the connection target is two columns, then the duplicate rule is two columns are not the same. There's a blog written earlier.

Insertsect, take intersection, two tables of the same data out, and sort by the first field, for example

Sql> Select Bumen, hanqbh from T_HQ2 intersect select Bumen, hanqbh from T_HQ;
Bumen HANQBH
-------------------- ----------
Sales Department 103

The intersection here, if the field is two or more, the program will follow the display results of all fields to find the intersection, the above example is, Bumen and HANQBH are the same will be removed.


Minus, take the difference set, the first set has, the second set does not have the data
You can sort by using order by.

Sql> Select Bumen, hanqbh from T_hq minus select Bumen, hanqbh from T_HQ2;
Bumen HANQBH
-------------------- ----------
Planning Department 102
Teachers Department 104

Sql>

Minus a connection, the first table is the primary table, and the data that is in the first table and not in the second table is displayed.

Some of the new tricks that were taught in class

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.