Write a query to combine two tables.
Example
Table : EmployeeID Name DepartmentID1 Sumit 12 Rohan 13 Sumit 24 Rohan 25 Sumit 26 Raja 1Table : DepartmentID Department1 IT2 MECombine OutputID Name Department DepartmentID1 Sumit IT 12 Rohan IT 13 Sumit ME 24 Rohan ME 25 Sumit ME 26 Raja IT 1
Approach
Mysql
Query: select e.ID, e.Name, d.Department, e.DepartmentID from Employee eleft outer join Department d on (e.DepartmentID=d.ID);
No comments:
Post a Comment