0

Hi all,
I need a favor on SQL this time

There are 4 tables as follows

Employee(EmpID,EmpName,...........)
Designation(Des_ID,Designation....)
EmpProfInfo(EmpID,Des_ID,..........)
Training(TrainingTypeID,EmpID,TrainingType,.......)

When an employee allocated to a training their details will be inserted in to the Training Table

I want to write a sql query so that I can select EmpID,EmpName,Designation of employees who do not participated in the particular training type

It would be a great help if anyone could show me a way to achieve this

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by samir_ibrahim
0

Im only in MYSQL but this might also works in MSSQL SELECT * FROM Employee WHERE Employee.EmpID NOT IN (SELECT EmpID FROM Training WHERE TrainingType=0);

0

Try this

SELECT Training.EmpID, Training.TrainingType, Employee.EmpName, EmpProfInfo.Des_ID, Designation.Designatio
FROM Designation RIGHT OUTER JOIN
Employee RIGHT OUTER JOIN
EmpProfInfo RIGHT OUTER JOIN
Training ON EmpProfInfo.EmpID = Training.EmpID ON Training.EmpID = Employee.EmpID ON Designation.Des_ID = EmpProfInfo.Des_ID
WHERE (Training.TrainingType <> 'Type1')

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.