G
Guest
Dear Experts,
I would like to run a select statement with a select statement. For example,
I am having a table named "employee". I am selecting information of the
employee as well as the supervisor's and HOD's information. the supervisor's
and HOD's information are also in the same table. Therefore I came out with
my sql statement as follow:
SELECT employee.employeenum, employee.name, employee.supervisor AS supvno,
(select [name] from employee where employeenum=supervisor) AS Expr1
FROM Department INNER JOIN employee ON Department.Dep = employee.department;
However, the result displayed on the expr1 is all the same value although
the supervisor code are different. Please advise. Many thanks in advance.
I would like to run a select statement with a select statement. For example,
I am having a table named "employee". I am selecting information of the
employee as well as the supervisor's and HOD's information. the supervisor's
and HOD's information are also in the same table. Therefore I came out with
my sql statement as follow:
SELECT employee.employeenum, employee.name, employee.supervisor AS supvno,
(select [name] from employee where employeenum=supervisor) AS Expr1
FROM Department INNER JOIN employee ON Department.Dep = employee.department;
However, the result displayed on the expr1 is all the same value although
the supervisor code are different. Please advise. Many thanks in advance.