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 8036137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:31:08+00:00 2026-06-05T02:31:08+00:00

SELECT MIN (snap_id) AS FIRST_SNAP, MAX (snap_id) AS LAST_SNAP, MIN (BEGIN_INTERVAL_TIME) AS FIRST_QUERY, MAX

  • 0
SELECT MIN (snap_id) AS FIRST_SNAP,
     MAX (snap_id) AS LAST_SNAP,
     MIN (BEGIN_INTERVAL_TIME) AS FIRST_QUERY,
     MAX (END_INTERVAL_TIME) AS LAST_QUERY,
     max(end_interval_time) - min(begin_interval_time) as "TIME_ELAPSED"
FROM dba_hist_snapshot
ORDER BY snap_id;

2931    3103    5/28/2012 6:00:11.065 AM    6/4/2012 11:00:40.967 AM    +07 05:00:29.902000

I would like the last columns output to be 7 (for the days). I have tried trunc and extract like some other posts mentioned but can’t seem to get the syntax right. Any ideas?

  • 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-05T02:31:09+00:00Added an answer on June 5, 2026 at 2:31 am

    Judging from your comment, you’re using timestamp columns, not datetime. You could use extract to retrieve the hour difference, and then trunc(.../24) to get the whole number of days:

    trunc(extract(hour from max(end_interval_time) - min(begin_interval_time))/24)
    

    Or you could cast the timestamp to a date:

    trunc(cast(max(end_interval_time) as date) -
        cast(min(begin_interval_time) as date))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following SQL Query. SELECT MIN(PLD.available_date) as 'FROM', MAX(PLD.available_date) as 'UNTIL', (
select min(lead), max(lead) from products WHERE part_line != 90 and category = 'x' When
Let's say.. I have two statements select min(Log_In_Time) from tbl where (event_ID=4) select max(Log_Off_Time)
My query... SELECT MIN(p.`land_price`) AS `min_price`, MAX(p.`land_price`) AS `max_price`, p.`estate`, m.`file` FROM `properties` AS
For this query SELECT min(date) min_date FROM order_products group by order_id min_date ignores the
What is equal of below sql in LINQ select MIN(finishTimestamp) AS FromDate, MAX(finishTimeStamp) AS
I'm selecting my data with the following statement: select distinct min(revision_number) as revno,po_number from
How to do Group by query (for e.g. Select column1,column2,min(value) from Foo_Bar where value>
We have the query: SELECT ID, MIN(SQRT(POW((100-x),2)) + POW((150-y),2)) AS distance FROM cabstands GROUP
Here's the query: SELECT COUNT(*) AS c, MAX(`followers_count`) AS max_fc, MIN(`followers_count`) AS min_fc, MAX(`following_count`)

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.