My query:
SELECT AVG(time_out - time_in) from time_table
Result:
3 days 17:21:21.062313
The problem is, the computed average also has the fractional part of a second .062313, which I don’t need, so I must drop it. How do I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
date_truncshould do this:SELECT date_trunc('second', avg(time_out - time_in)) FROM time_table