+ 8
[Solved] Sql Data Retrieve issue
I want fetch whose employee details that not mark attendance on a particular date '2021-05-18' 'EmpDetails' Table EmplyoyeeID, EmployeeName IT:0001, GAURAV DIXIT IT:0002, VAIBHAV SINGH IT:0003, RAJESH PANDEY 'EmpAttendance' Table id, DATE, Emp_ID, Attendance_status 1, 2021-05-18, IT:001, Present
3 Antworten
- 1
SELECT *
FROM employeedetails
WHERE EmployeeID NOT IN (SELECT emp_id
FROM staffattendance
WHERE date ='2021-05-18')
THIS IS CALLED SUB-QUERIES
+ 7
You can filter that 'DATE' and 'status' field using WHERE clause.
Why you store employee names in 'EmpAttendance' table?
(Edit)
Table structure in thread Description has been modified.
+ 1
select EmpDetails.Emp_ID, EmployeeName FROM EmpDetails NATURAL JOIN WHERE EmpDetails.Emp_ID= EmpAttendence.Emp_′ID and Attendance_status='absent' and Date='2021-05-18';