The following query is based upon two tables as follows:
tblEmployees:
emp_num Integer Key
emp_first_name VarChar2(20)
emp_surname VarChar2(25)
man_num Integer Foreign Key
tblManagers:
man_num Integer Key
man_first_name VarChar2(20)
man_surname VarChar2(25)
SELECT tblEmployees.emp_first_name, tblEmployees.emp_surname, tblManagers.man_first_name, tblManagers.man_surname
FROM tblEmployees, tblManagers
WHERE tblEmployees.man_num = tblManagers.man_num
AND tblEmployees.man_num = 1
This will return all employees of manager number 1
Without meaning to sound rude, when posting a problem like this it is helpful to give a thorough description of your tables and exactly what it is that you are trying to achieve, you will get a more detailed response!!!
Enter your message below
Sign in or Join us (it's free).