This works to return a name:
SELECT Fname, Lname FROM EMPLOYEE WHERE dno = 4 AND Ssn = 999887777;
returns the employee's name.
But this returns nothing:
SELECT Fname, Lname FROM EMPLOYEE WHERE dno = 4 AND Ssn = (SELECT essn FROM WORKS_ON);
I want to get the names of all employees in Dept. No. 4 whose employee SSNs are found in the WORKS_ON table.
'essn' and 'Ssn' are both 9-character text fields that work in other contexts.
Aucun commentaire:
Enregistrer un commentaire