Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle_071_lesson_p9

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Set operation

UNION and UNION ALL

UNION: column name. If the data type is consistent, the result will be sorted automatically by default ASC.

UNION ALL: the result will not be duplicated or sorted, and everything else is the same as UNION.

Fill in missing columns with things like to_char (null), to_number (null), to_date (null)

Such as:

Select job_id

From employees

UNION

Select job_id

From retired_employees

Such as:

Select job_id,department_id

From employees

UNION ALL

Select job_id,department_id

From retired_employees

Order by job_id

Intersect take intersection

The results will be sorted and duplicated.

Such as:

Select manager_id,department_id

From employees

INTERSECT

Select manager_id,department_id

From retired_employees

Pre-MINUS select results minus and post-select de-repeating results

Such as:

Select employee_id, job_id

From employees

Where department_id=80

MINUS

Select employee_id, job_id

From retired_employees

Where department_id=90

The above four outputs are only concerned with the definition of select in Article 1.

Order by can only be placed at the end, and can only appear once, and cannot be placed in a subquery.

Parenthes parentheses can change the execution priority.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report