我需要对 MySQL 表上的同一字段进行查询,但参数不同。这是我的查询。出现的问题是 MySQL 说 users_name 不明确。
SELECT projects_id,
projects_users_id,projects_companies_id,projects_name,
projects_description,project_registered_date,
projects_users_id_register,
users.users_name as userInCharge,companies.companies_name as company,
users.users_name as user_register FROM projects
LEFT JOIN users as userInCharge ON (users_id = projects_users_id)
LEFT JOIN users as register ON (users_id=projects_users_id_register)
LEFT JOIN companies ON (companies_id = projects_companies_id) ORDER BY projects_id DESC
我的目标是获取项目负责人和注册项目的人的ID。我该怎么做呢?