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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:49:00+00:00 2026-06-04T16:49:00+00:00

I need help with an SQL-Query. I have one table with many entries and

  • 0

I need help with an SQL-Query. I have one table with many entries and I want to query all the entries which have the same values for the last 3 columns.

My table looks as follows:

|Refrigator|98C08A|2011-08-06 00:00:30|126|126
|Refrigator|B7BE29|2011-08-06 00:00:30|73|70
|Refrigator|599393|2011-08-06 00:00:30|126|126
|Refrigator|B7BE29|2011-08-06 00:00:29|73|70
|Refrigator|599393|2011-08-06 00:00:29|126|126
|Refrigator|599393|2011-08-06 00:00:29|126|126
|Refrigator|98C08A|2011-08-06 00:00:29|126|126
|Refrigator|98C08A|2011-08-06 00:00:29|126|126
|Refrigator|599393|2011-08-06 00:00:28|126|126

So I want to get all rows, which have the exact same values for the last 3 columns, so the result should look like:

|Refrigator|98C08A|2011-08-06 00:00:30|126|126
|Refrigator|599393|2011-08-06 00:00:30|126|126
|Refrigator|599393|2011-08-06 00:00:29|126|126
|Refrigator|599393|2011-08-06 00:00:29|126|126 (if possible without this duplicate)
|Refrigator|98C08A|2011-08-06 00:00:29|126|126
|Refrigator|98C08A|2011-08-06 00:00:29|126|126 (if possible without this duplicate)

Does anyone have an idea how to manage this?
What I tried so far was:

SELECT * 
FROM smtab 
WHERE Datetime IN (
      SELECT Datetime 
      FROM smtab 
      GROUP BY Datetime 
      HAVING count(Datetime) >1) 
AND Power1 IN (
      SELECT Power1 
      FROM smtab 
      GROUP BY Power1 
      HAVING count(Power1) >1) 
AND Power8 IN (
      SELECT Power8 
      FROM smtab 
      GROUP BY Power8 
      HAVING count(Power8) >1) 
ORDER BY Datetime DESC;

but I didn’t work!!!

Hope someone can help me! thx in advance…

  • 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-04T16:49:01+00:00Added an answer on June 4, 2026 at 4:49 pm
    SELECT DISTINCT *
    FROM   smtab NATURAL JOIN (
      SELECT   Datetime, Power1, Power8
      FROM     smtab
      GROUP BY Datetime, Power1, Power8
      HAVING   COUNT(*) > 1
    ) AS t
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

need help/guide for sql select query, I have 2 table stock and stock_history, in
I need help with a SQL Query I have this table likes friend friend2
i need some help with a sql query. I have a table called 'table1'
Need a little help with a SQL / ActiveRecord query. Let's say I have
I need some help with SQL Query. I am trying to select all records
today i need your help to get an specific sql select query. i have
Need help from you all in writing up this query. Running SQL 2005 Standard
I'm somewhat new to SQL and need help with query syntax. My issue involves
I am new to SQL Server 2008, and I need some help in query
I need help with the SQL ORDER BY clause. In my table below I

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.