Hi i need help with a query
I have a table Where Jobs and Employee are linked its called EmployeeToJobsApplied
Id EmployeeId JobsId Applied Viewed
1 1 1 True True
2 1 2 False True
3 1 1 True True
4 1 3 True True
If you noticed there are repeating values like in ID=3
I didn’t create the database structure. I can’t do much about the table structure as of this point since this is a post production project.
The thing i can change is the StoredProcedure that could retrieve information from this table.
So what i need is a single column sigle row value of the Total of Jobs Applied
So basically what i need based on this example is to get a value of
2 Jobs Applied for Employee ID = 1
i want to ignore the duplicates.
Thank You!
Please feel free to edit/retag
UPDATE
I do need the total of the result,
I need the total count (not the list) of Employees who applied for a specific job.
I tried using count and i’ts not working accordingly, Because it counts also those who are not distinct. Thank you for your kind help
If you need to aggregate on distinct values, then you can write: