Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- Employees.name as EmpName,
- (select count(LateDays.LateDate)*200 from Employees inner join LateDays on Employees.EmpId = LateDays.EmployeeEmpId) as TotalFine,
- count(LateDays.LateDate)*200 as PaidFine,
- (select COUNT(LateDays.Informed)from Employees inner join LateDays on Employees.EmpId = LateDays.EmployeeEmpId where LateDays.Informed='true') as InformedDays
- FROM
- Employees inner join LateDays
- on Employees.EmpId = LateDays.EmployeeEmpId
- WHERE
- LateDays.FinePaid = 1
- GROUP BY
- name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement