I have two table in Access, Employee and Dept.
In Employee table there is empname column and deptcode column, while in Dept table there is deptcode column and deptname column.
I want to do a query which shows empname, deptcode and deptname in a new table. I have tried:
SELECT empname, deptcode, deptname
You need to alias your tables in the FROM clause and then use the table alias in the SELECT statement.
select e.empname,d.deptcode,d.deptname from employee e inner join dept d on e.deptcode = d.deptcode;