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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:10:01+00:00 2026-05-15T00:10:01+00:00

Excuse me for posting a similar question. Please consider this: date value 18/5/2010, 1

  • 0

Excuse me for posting a similar question. Please consider this:

date                 value

18/5/2010, 1 pm        40
18/5/2010, 2 pm        20
18/5/2010, 3 pm        60
18/5/2010, 4 pm        30
18/5/2010, 5 pm        60
18/5/2010, 6 pm        25 
19/5/2010, 6 pm        300 
19/5/2010, 6 pm        450 
19/5/2010, 6 pm        375 
20/5/2010, 6 pm        250 
20/5/2010, 6 pm        310 

The query is to get the date and value for each day such that the value obtained for that day is max. If the max value is repeated on that day, the lowest time stamp is selected. The result should be like:

18/5/2010, 3 pm        60
19/5/2010, 6 pm        450
20/5/2010, 6 pm        310

The query should take in a date range like the one given below and find results for that range in the above fashion:

where
date >= to_date(’26/03/2010′,’DD/MM/YYYY’) AND
date < to_date(’27/03/2010′,’DD/MM/YYYY’)

  • 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-05-15T00:10:02+00:00Added an answer on May 15, 2026 at 12:10 am

    If you provide a CREATE TABLE and INSERT, it makes it a lot easier to provide a tested answer.

    create table i (i_dt date, i_val number);
    
    insert into i values (to_date('18/5/2010 1pm','dd/mm/yyyy hham'),        40);
    insert into i values (to_date('18/5/2010 2pm','dd/mm/yyyy hham'),        20);
    insert into i values (to_date('18/5/2010 3pm','dd/mm/yyyy hham'),        60);
    insert into i values (to_date('18/5/2010 4pm','dd/mm/yyyy hham'),        30);
    insert into i values (to_date('18/5/2010 5pm','dd/mm/yyyy hham'),        60);
    insert into i values (to_date('18/5/2010 6pm','dd/mm/yyyy hham'),        25 );
    insert into i values (to_date('19/5/2010 6pm','dd/mm/yyyy hham'),        300 );
    insert into i values (to_date('19/5/2010 6pm','dd/mm/yyyy hham'),        450 );
    insert into i values (to_date('19/5/2010 6pm','dd/mm/yyyy hham'),        375 );
    insert into i values (to_date('20/5/2010 6pm','dd/mm/yyyy hham'),        250 );
    insert into i values (to_date('20/5/2010 6pm','dd/mm/yyyy hham'),        310 );
    
    select i_dt, i_val from 
       (select i.*, rank() over (partition by trunc(i_dt) order by i_val desc, i_dt asc) rn 
       from i) 
    where rn = 1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am bouncing between posting this here and on Superuser. Please excuse me if
I'm new to python, so please excuse what is probably a pretty dumb question.
So this is my first posting on StackOverflow, so excuse me if my request
Excuse me for not quite a programming question, but I need to burn a
Please excuse the vague title. If anyone has a suggestion, please let me know!
Please excuse my ignorance on the topic, as I am relatively new to Hibernate
Here's one I have always wondered about... Please excuse my naivety, but - How
Ok, I'm an MVC newbie coming from a webforms background, so please excuse any
I have the following website (and please excuse the language of the site, it's
First time poster, so please excuse any stupidity. I'm working on porting a custom

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.