這裏是我的SQL查詢:爲什麼我得到這個錯誤?語法錯誤或訪問衝突:1066不是唯一的表/別名:「員工」
SELECT Employees.employee_id AS `Employees__employee_id`,
Employees.designation_id AS `Employees__designation_id`,
Employees.first_name AS `Employees__first_name`,
Employees.last_name AS `Employees__last_name`,
Employees.address AS `Employees__address`,
Employees.contact_no AS `Employees__contact_no`,
Employees.joining_date AS `Employees__joining_date`,
Employees.username AS `Employees__username`,
Employees.password AS `Employees__password`,
Employees.basic_pay AS `Employees__basic_pay`,
Employees.create_date AS `Employees__create_date`,
Employees.status AS `Employees__status`,
Designations.designation_id AS `Designations__designation_id`,
Designations.designation_name AS `Designations__designation_name`,
Designations.description AS `Designations__description`
FROM employees Employees
INNER JOIN employees Employees
ON Employees.employee_id = (Employees.employee_id)
INNER JOIN designations Designations
ON Designations.designation_id = (Employees.designation_id)
LIMIT 20 OFFSET 0
我得到的錯誤是:
Error: SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias: 'Employees'!
你能不能幫我在這。
Thanx pro。我如何編輯cakephp中的查詢? –