I have my Table structure like this ::
ATT_Table : Fields - Act_ID, Assigned_To_ID, Percent_Complete(Integer value)
Act_ID is primary key, Assigned_To_ID is referenced to Emp_ID in Employee_Table.
Employee_Table : Fields - Emp_ID, F_Name.
Emp_ID is primary key.
Now at a particular point in time, 1 or more activities can be assigned to same person. My goal is write a query to calculate a person's load. I want to count the number of activities assigned to a particular person (can be more than 1) then take the average of their percent_Complete.
For example if person A is assigned A1, A2, A3(Act_ID). Then corresponding (Percent_Complete values addition)/3. Basically an average. In my final query result I want:
Name, Number of activities assigned(Count), load value(Avg).
How do I this? Do I have to use a nested WHERE IN clause ? Thanks.