我有 3 个这样的表:
表用户
+---------+-----------------+
| UserId | UserName |
+---------+-----------------+
| 1 | one@test.com |
| 2 | two@test.com |
| 3 | three@test.com |
| 4 | four@test.com |
+---------+-----------------+
表员工
+-------------+----------------+------------+----------+---------+
| EmployeeId | Email | Department | Position | Duty |
+-------------+----------------+------------+----------+---------+
| 1 | one@test.com | Accounting | Manager | Aproval |
| 2 | two@test.com | Accounting | Manager | NULL |
| 3 | three@test.com | Marketing | Staff | NULL |
| 4 | four@test.com | Purchasing | Staff | NULL |
+-------------+----------------+------------+----------+---------+
表授权
+------------------+----------------+------------+----------+----------+
| AuhtorizationId | Level | Department | Position | Duty |
+------------------+----------------+------------+----------+----------+
| 1 | 1 | Accounting | Manager | NULL |
| 2 | 2 | Marketing | Staff | NULL |
| 3 | 3 | Purchasing | Staff | NULL |
| 4 | 4 | Accounting | Manager | Approval |
+------------------+----------------+------------+----------+----------+
如何构造一个 MySQL 查询来检索 UserId、UserName/Email、Level、Department 和 Position?