'#1066 - Not unique table/alias: 'EMP'

I am trying to create a query for my table but I get error. I have two tables in the database called 'assignment' and my two tables are 'emp' and 'dept'.

SELECT EMP.EMPNO, EMP.ENAME, EMP.SAL, DEPT.DNAME
FROM assignment.EMP, assignment.DEPT
INNER JOIN EMP on EMP.DEPTNO=DEPT.DEPTNO
WHERE EMP.SAL > 1000
AND DEPT.DNAME="SALES" LIMIT 0, 25
MySQL said: Documentation

#1066 - Not unique table/alias: 'EMP'



Solution 1:[1]

Fixed your JOIN.

SELECT EMP.EMPNO, EMP.ENAME, EMP.SAL, DEPT.DNAME
FROM assignment.DEPT INNER JOIN assignment.EMP ON EMP.DEPTNO = DEPT.DEPTNO
WHERE EMP.SAL > 1000 AND DEPT.DNAME = "SALES" LIMIT 0, 25

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chris Albert