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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:05:59+00:00 2026-06-09T04:05:59+00:00

I have a table with the columns id,artist_id,web. I have found a query with

  • 0

I have a table with the columns id,artist_id,web. I have found a query with which I can display web duplicates like so:

SELECT DISTINCT b.artist_id AS artist1, b.web AS web1, a.artist_id AS artist2, a.web AS web2 FROM artist_webs a INNER JOIN artist_webs b ON b.web=a.web AND b.web!='NULL' AND b.artist_id!=a.artist_id

So, it displays different artists that have the same web address. The only problem though is that it displays entries that are essentially the same twice or more times. E.g., a result could look like:

Row 1
artist1: 21399
artist2: 1036

Row 2
artist1: 1036
artist2: 21399

Of course, for the database these are different entries, but it it obvious to a human being that they are the same as they refer to the same artist ids with the same web addresses. The first row would be enough.

So, all that is really needed is a modification of the query above that will display distinct rows regardless of the order in which the ids appear.

Thanks!

  • 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-09T04:06:01+00:00Added an answer on June 9, 2026 at 4:06 am

    When joining on the same table I always add something like

    b.artist_id < a.artist_id
    

    instead of your

    b.artist_id!=a.artist_id
    

    That way they are not only “not the same”, but also you skip on the ‘reverse’ sollution.

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

Sidebar

Related Questions

I have a table with two columns - artist, release_id What query can I
How can I display data in two columns? <?php $query = SELECT * FROM
I have a table with columns like entityID, entityName, parentID How can I write
I have table which contains columns like SiteID (identity_Col) SiteName POrderID Location Address Cluster
I have a table with around 15 columns which can be queried with different
I have table with 3 columns A B C. I want to select *
I have one show table which have 25 lakh records in it. Columns in
I have my table columns set like this: likes(id, like_message, timestamp) id is the
I have a table columns:Name,Role,Dept A person can have many roles. So while retrieving
Group, I have table columns ProductID, latitude,longitude,timestampGMT and looking for a query to 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.