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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:36:58+00:00 2026-05-26T08:36:58+00:00

I would like to ask for help on how to fix this. I would

  • 0

I would like to ask for help on how to fix this. I would like to add a MIN or some sort of query to only show lowest number on the TotalTime base on the SQL query below.

The query is working but it show duplicate data and I only want to get the lowest TotalTime.

Thanks in advance.

SELECT DISTINCT t1.name, 
  t1.Description, 
  t1.Issue, 
  t1.Dateres AS ATime, 
  t2.Dateres AS BAck, 
  TIMEDIFF(t2.Dateres,t1.Dateres) AS TotalTime, 
  t2.Acknowledge, t2.Resolution 
FROM t1
LEFT JOIN t2 ON t1.name = t2.name 
  AND t1.IPAddress = t2.IPAddress 
  AND t1.Description = t2.Description 
  AND t1.Issue = t2.Issue 
  AND t1.Severity = t2.Severity 
  AND t1.Timestamp = t2.Timestamp 
WHERE t1.Dateres IS NOT NULL
  AND t2.Dateres IS NOT NULL 
  AND t2.Acknowledge = 'user@home.net' 
  AND t2.Dateres >= '2011-10-18 00:00:00' 
  AND t2.Dateres <= '2011-10-23 23:59:59' 
GROUP BY ATime
ORDER by BAck ASC;
  • 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-26T08:36:58+00:00Added an answer on May 26, 2026 at 8:36 am
    SELECT 
    t1.name, 
    t1.Description, 
    t1.Issue, 
    t1.Dateres AS ATime, 
    t2.Dateres AS BAck, 
    Min(TIMEDIFF(t2.Dateres,t1.Dateres)) AS TotalTime, 
    t2.Acknowledge, t2.Resolution 
    FROM t1 LEFT JOIN t2 ON t1.name = t2.name 
    AND t1.IPAddress = t2.IPAddress 
    AND t1.Description = t2.Description 
    AND t1.Issue = t2.Issue 
    AND t1.Severity = t2.Severity 
    AND t1.Timestamp = t2.Timestamp 
    WHERE t1.Dateres is NOT NULL AND t2.Dateres is NOT NULL 
    AND t2.Acknowledge = 'user@home.net' 
    AND t2.Dateres >= '2011-10-18 00:00:00' 
    AND t2.Dateres <= '2011-10-23 23:59:59' 
    GROUP BY t1.name ORDER by BAck ASC;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to ask some help. This is not homework but it is
I would like to ask some Drupaler for help. Is it possible to show
Good morning! I would like to ask some help from you guys on how
I would like to ask for help with this, I wanted to check for
i would like to ask some help from you guys. i am making a
I would like to ask for some help to understand an error report. I
Hello everybody :D I would like to ask for your help on this problem.
i would like to ask for your help since I'm having difficulty resolving this
I would like to ask for help on how to achieve this. I have
I would like to ask for help. I got this homework to create a

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.