I can use some help with a query. I have two tables:
employee = {
id,
manager,
data1,
}
hrm = {
id,
employee,
data2,
};
The Query. I like to have all hrm records from the employees which have Tom as manager.
SELECT hrm.employee, hrm.data2 FROM hrm WHERE AND EXISTS
(SELECT id from employee WHERE manager = 'TOM')
This gives me
Jan, data2
Piet, data2
Great! but I want more. :-) I also like to have the associated data1 column from employee.
Jan, data2, data1
Piet, data2, data1
Any help is appreciated.