0
Sql query
Can someone help me with arranging a query for SQL? I need to count average time for a day? Thanks.
3 ответов
+ 1
Daniel Gheorghita did you misspell the DATEDIFF() function?
Missing comma after Date_Time.
To get the average time, use the aggregate average function
AVG(DATEDIFF(.....)) averagetime
0
This is a question better suited for Google since you're not even specifying which SQL language.
0
Transact sql,
Task to find an average time for all orders in the specific day:
So:
SELECT
Date_Time
Daferiff(hour, creation_date_time, ship_date_time) averagetime
From shipments
Where company = ‘abc’
And creation_date_time = ‘2022-05-23’ and ship_date_time is not null.