How do you use Equi Join to join two tables with the same name?
SQLite
I am trying to join two tables with the same name. I am required to use an inner join
Also I need to show the managers name.
Question is:
Join the employee table with the employee table and department table.
Show the employee id, name, dept code, manager id, manager name,
managers department code, and name for that (mgr's) department.
We have a self join, each copy of the table is given an "alias" - here we
use w for the worker and b for the boss. We can treat these as different tables.
You get an inner join by default - this means that Robin (who has no boss)
does not show up in the results.
Specific to SQLite
none
DB2
I am trying to join two tables with the same name. I am required to use an inner join
Also I need to show the managers name.
Question is:
Join the employee table with the employee table and department table.
Show the employee id, name, dept code, manager id, manager name,
managers department code, and name for that (mgr's) department.
We have a self join, each copy of the table is given an "alias" - here we
use w for the worker and b for the boss. We can treat these as different tables.
You get an inner join by default - this means that Robin (who has no boss)
does not show up in the results.
Specific to DB2
none
MS Access
I am trying to join two tables with the same name. I am required to use an inner join
Also I need to show the managers name.
Question is:
Join the employee table with the employee table and department table.
Show the employee id, name, dept code, manager id, manager name,
managers department code, and name for that (mgr's) department.
We have a self join, each copy of the table is given an "alias" - here we
use w for the worker and b for the boss. We can treat these as different tables.
You get an inner join by default - this means that Robin (who has no boss)
does not show up in the results.
Specific to MS Access
none
PostgreSQL
I am trying to join two tables with the same name. I am required to use an inner join
Also I need to show the managers name.
Question is:
Join the employee table with the employee table and department table.
Show the employee id, name, dept code, manager id, manager name,
managers department code, and name for that (mgr's) department.
We have a self join, each copy of the table is given an "alias" - here we
use w for the worker and b for the boss. We can treat these as different tables.
You get an inner join by default - this means that Robin (who has no boss)
does not show up in the results.
Specific to PostgreSQL
none
Oracle
I am trying to join two tables with the same name. I am required to use an inner join
Also I need to show the managers name.
Question is:
Join the employee table with the employee table and department table.
Show the employee id, name, dept code, manager id, manager name,
managers department code, and name for that (mgr's) department.
We have a self join, each copy of the table is given an "alias" - here we
use w for the worker and b for the boss. We can treat these as different tables.
You get an inner join by default - this means that Robin (who has no boss)
does not show up in the results.
Specific to Oracle
MS SQL Server
I am trying to join two tables with the same name. I am required to use an inner join
Also I need to show the managers name.
Question is:
Join the employee table with the employee table and department table.
Show the employee id, name, dept code, manager id, manager name,
managers department code, and name for that (mgr's) department.
We have a self join, each copy of the table is given an "alias" - here we
use w for the worker and b for the boss. We can treat these as different tables.
You get an inner join by default - this means that Robin (who has no boss)
does not show up in the results.
Specific to MS SQL Server
none
MySQL
I am trying to join two tables with the same name. I am required to use an inner join
Also I need to show the managers name.
Question is:
Join the employee table with the employee table and department table.
Show the employee id, name, dept code, manager id, manager name,
managers department code, and name for that (mgr's) department.
We have a self join, each copy of the table is given an "alias" - here we
use w for the worker and b for the boss. We can treat these as different tables.
You get an inner join by default - this means that Robin (who has no boss)
does not show up in the results.
Specific to MySQL
none
Sybase
I am trying to join two tables with the same name. I am required to use an inner join
Also I need to show the managers name.
Question is:
Join the employee table with the employee table and department table.
Show the employee id, name, dept code, manager id, manager name,
managers department code, and name for that (mgr's) department.
We have a self join, each copy of the table is given an "alias" - here we
use w for the worker and b for the boss. We can treat these as different tables.
You get an inner join by default - this means that Robin (who has no boss)
does not show up in the results.
Specific to Sybase
none
Mimer SQL
I am trying to join two tables with the same name. I am required to use an inner join
Also I need to show the managers name.
Question is:
Join the employee table with the employee table and department table.
Show the employee id, name, dept code, manager id, manager name,
managers department code, and name for that (mgr's) department.
We have a self join, each copy of the table is given an "alias" - here we
use w for the worker and b for the boss. We can treat these as different tables.
You get an inner join by default - this means that Robin (who has no boss)
does not show up in the results.