Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle series: (13) Multi-table query

Shulou Source: shulou.com Published: 2022-06-01 08:26:16 09月28日 Update

Multi-table query, including equivalent join, non-equivalent join, external join, self-join.

Internal connections, including equivalent connections and non-equivalent connections.

Cartesian set of employee table emp and department table dept (Cartesian set table = sum of columns, product of rows, some data in Cartesian table does not meet the requirements)

Select emp.ename,dept.dnamefrom emp,dept

Use equivalent / internal connections (only the = sign can be used) to display the employee's number, name, department name, and simplify using table aliases

Select emp.empno,emp.ename,dept.dname,dept.deptnofrom emp,deptwhere emp.deptno = dept.deptno

Use a non-equivalent connection (you cannot use the = sign, other symbols can, for example: > =

Tags: Departments number of people inquiries employees superiors conditions Descartes name statistics party sum alias only multiple fields salary data monthly salary format symbol Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology Huawei MariaDB Shulou Information