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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:55:57+00:00 2026-05-12T14:55:57+00:00

i have this data and i am trying to find cases where there are

  • 0

i have this data and i am trying to find cases where there are different ids but duplicate data in Field 1,2,3,4

id    field1 field2 field3 field4    
====  ====== ====== ===== =======    
1       A      B     C      D    
2       A      B     C      D    
3       A      A     C      B   
4       A      A     C      B

so, in whatever way possible, in this case i want it to somehow show me:

1 & 2 are duplicates
3 & 4 are duplicates

  • 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-12T14:55:57+00:00Added an answer on May 12, 2026 at 2:55 pm

    Instead of SELECT DISTINCT, select the fields and a count of rows. Use HAVING to filter out items with more than one row, e.g:

    select field1
          ,field2
          ,field3
          ,field4
          ,count (*)
      from foo
     group by field1
             ,field2
             ,field3
             ,field4
    having count (*) > 1
    

    You can then join your original table back against the results of the query.

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

Sidebar

Related Questions

I am trying to have a tree display custom data that looks like this.
I have this data: /blabla/blabla (abs,def) /yxz I use this regex (.*)(?:\(([^$]*)\))?\n But it
Maybe this is a shot in the dark here but I'm trying to find
I have this data from a xml file: <?xml version=1.0 encoding=utf-8 ?> <words> <id>...</id>
I have this data: 1, 0., 0., 1500. . . 21, 0., 2000., 1500.
I have this data in a table, for instance, id name parent parent_id 1
Let say if I have this data my_data = [ 10 20 30 40;
I have this class: public MyClass { public void initialize(Collection<String> data) { this.data =
Say I have this table schema. ID AccNo Amount Say I have this data
I'm using PostgreSQL 9.1 and I have this data structure: A B ------- 1

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.