Get the App
SLTechnology News&Howtos  ›  Database  › 

Mysql self-connection

Shulou Source: shulou.com Published: 2022-06-01 09:33:47 10月05日 Update

# case: query the employee name and the superior's name, find the superior's id through the employee's name, and then find the superior's employee's name through the superior's id

SELECT e.employee_id,e.last_name,m.manager_id,m.last_nameFROM employees AS e,employees AS mWHERE m.employee_id=e.manager_id

Tags: Superior employee name case inquiry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Linux vpn Docker Apple