Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8313321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:27:07+00:00 2026-06-08T20:27:07+00:00

I have table like this: name number total_time avg_time tom 10 00:02:28 ? kevin

  • 0

I have table like this:

name   number   total_time    avg_time
tom      10      00:02:28        ?
kevin    6       09:22:25        ?

total_time is type of interval, I can easily change to string.
now, I want to get the avg_time like this

avg_time = total_time / number;

I wander how to get the result ? I try to calculate day, hour, min, sec, but it’s too difficult , anyone who can give me some advice ? thanks a lot

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:27:09+00:00Added an answer on June 8, 2026 at 8:27 pm

    Hopefully this example (based on yours) is helpful:

    postgres=# SELECT *, total_time / number AS avg_time 
        FROM (SELECT INTERVAL '00:02:28' AS total_time, 10 AS number) a;
     total_time | number |  avg_time  
    ------------+--------+------------
     00:02:28   |     10 | 00:00:14.8
    (1 row)
    

    Can you be more specific about what part of this isn’t working for you?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table like this: name code group john 12 smith 15 how
Let's say I have a table like this: name |order_id ======================= first_record | 0
I have a table like this ID Name IsDeleted 1 Yogesh Null 2 Goldy
I have a table in mysql like this Name Result T1_09_03_2010 fail T2_09_03_2010 pass
I have a table that looks like this: Name Job Year ImpFile ImpDate ------------------------------------------------
Possible Duplicate: Concatenate row values T-SQL I have a table like this: ref_num name
I have a table that looks like this: table name: uno str_id | title
i have a table like this one: -------------------------------- id | name -------------------------------- 1 |
I have a table like this (simplified): ID | Name | Parent --------------------------------- 1
I have a mysql table , which holds data like this. Name |how_out |runs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.