+ 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

18th May 2021, 1:55 PM
Gaurav Dixit🇮🇳
Gaurav Dixit🇮🇳 - avatar
3 Réponses
- 1
SELECT * FROM employeedetails WHERE EmployeeID NOT IN (SELECT emp_id FROM staffattendance WHERE date ='2021-05-18') THIS IS CALLED SUB-QUERIES
19th May 2021, 5:36 PM
Gaurav Dixit🇮🇳
Gaurav Dixit🇮🇳 - avatar
+ 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.
18th May 2021, 2:02 PM
Ipang
+ 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';
1st Jul 2021, 7:10 AM
Mainul Hasan Rifat
Mainul Hasan Rifat - avatar