Hello this is my SQL statement:
SELECT date_trunc('minute',AVG(AGE(t.close_date,t.creation_date))) AS TimeFrame, COUNT(t.task_id) , t.assigned_id AS Asignee, w.client_id AS Organization FROM task AS t,workbasket AS w WHERE t.location_name iLIKE 'Sales%'|| '|' || 'Create Work Order%' AND t.assigned_id='organ' AND w.client_id iLIKE '100-%' AND w.task_id = t.task_id GROUP BY t.assigned_id, w.client_id
I am not getting a value for the first select. The problem is or at least I think, is that there is only one value in the database that fits the requirements, so I am thinking that running AVG on just one value returns nothing. Am I wrong? If I am right how can I get around this, any suggestions.
Thanks
SELECT date_trunc('minute',AVG(AGE(t.close_date,t.creation_date))) AS TimeFrame, COUNT(t.task_id) , t.assigned_id AS Asignee, w.client_id AS Organization FROM task AS t,workbasket AS w WHERE t.location_name iLIKE 'Sales%'|| '|' || 'Create Work Order%' AND t.assigned_id='organ' AND w.client_id iLIKE '100-%' AND w.task_id = t.task_id GROUP BY t.assigned_id, w.client_id
I am not getting a value for the first select. The problem is or at least I think, is that there is only one value in the database that fits the requirements, so I am thinking that running AVG on just one value returns nothing. Am I wrong? If I am right how can I get around this, any suggestions.
Thanks