-
Use ID to select info from other table
I have two tables:
- Employees
id|name
1.|Peter
2.|Andre
3.|Vincent
- Departments
id|department|employee
1 finance | 2
2 sales | 1
I am looking for a query that results the table Departments to show the actual name of the employee instead of a number by using the number (id).
Please help
-
Try something like:
select department, e.name as employee from Departments d join Employees e on d.employee = e.id where ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|