I have error on my Query
1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'dms.HrAttLogsFormatted.ScanIn' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Query :
SELECT
Employee.Id as Id,
Employee.FingerId as FingerId,
Employee.Name as Name,
Departement.Departement as Departement,
EmployeeShift.Shift as Shift,
ScanIn
FROM
HrEmployee as Employee
LEFT JOIN HrEmployeeShift as EmployeeShift
ON Employee.ShiftId = EmployeeShift.Id
LEFT JOIN CmDept as Departement
ON Employee.DeptId = Departement.Id
LEFT JOIN (
SELECT
TableEmployee.FingerId,
ScanIn
FROM
HrEmployee as TableEmployee,
HrAttLogsFormatted
WHERE
TableEmployee.FingerId = HrAttLogsFormatted.FingerId
AND DateIn = '2019-11-04'
GROUP BY HrAttLogsFormatted.FingerId
) AS HrJoinLogs
ON Employee.FingerId = HrJoinLogs.FingerId
WHERE
Employee.Status = 1
AND Employee.Flag = 1
AND Employee.ShiftId = 1
AND ScanIn is NULL
GROUP BY
Employee.Name
ORDER BY
Employee.Name ASC
Does anyone have a solution?
group by
at all? There is no aggregate function in your query. – GMB