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

  • Home
  • SEARCH
  • 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 9225921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:41:59+00:00 2026-06-18T04:41:59+00:00

EDIT: I will leave the post here as is, but what I really needed

  • 0

EDIT: I will leave the post here as is, but what I really needed to accomplish needed to be reposted. I didn’t explain the problem well enough. After trying again with quite a different starting point, I was able to get the query that I needed. That is explained here.

ORIGINAL QUESTION:
I’m having trouble. I have looked at similar threads, and I am unable to find a solution specific to this query. The database is very large, and group by seems to slow it down immensely.

The problem is I am getting duplicate results. Here is my query which causes duplicates:

SELECT 
  itpitems.identifier, 
  itpitems.name, 
  itpitems.subtitle, 
  itpitems.description, 
  itpitems.itemimg, 
  itpitems.mainprice, 
  itpitems.upc, 
  itpitems.isbn, 
  itpitems.weight, 
  itpitems.pages, 
  itpitems.publisher, 
  itpitems.medium_abbr, 
  itpitems.medium_desc, 
  itpitems.series_abbr, 
  itpitems.series_desc, 
  itpitems.voicing_desc,
  itpitems.pianolevel_desc,
  itpitems.bandgrade_desc,
  itpitems.category_code,
  itprank.overall_ranking,
  itpitnam.name AS artist,
  itpitnam.type_code 
FROM itpitems 
  INNER JOIN itprank ON ( itprank.item_number = itpitems.identifier ) 
  INNER JOIN itpitnam ON ( itpitems.identifier = itpitnam.item_number ) 
WHERE mainprice >1

The results are actually not complete duplicates. itpitnam.type_code has a different result in the otherwise duplicated results.

Since adding GROUP BY to the end of the query is causing too much strain on the server (It’s searching through about 300,000 records) what else can I do?

Can this be re-written as a sub-query? I just can’t figure out how to eliminate the 2nd instances where type_code has changed.

Thank you for your help and assistance.

I also tried SELECT DISTINCT itpitems.identifier, but this served out the same results and had the duplicates (where type_code was the only difference). I don’t want the second instance where type_code has changed. I just want one result per identifier regardless of whether or not type_code has multiple instances.

  • 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-18T04:42:00+00:00Added an answer on June 18, 2026 at 4:42 am

    Without seeing examples of the output, hard to say. But have you tried the same exact query with a simple DISTINCT added to the SELECT?

    SELECT DISTINCT itpitems.identifier, itpitems.name, itpitems.subtitle, itpitems.description, itpitems.itemimg, itpitems.mainprice, itpitems.upc, itpitems.isbn, itpitems.weight, itpitems.pages, itpitems.publisher, itpitems.medium_abbr, itpitems.medium_desc, itpitems.series_abbr, itpitems.series_desc, itpitems.voicing_desc, itpitems.pianolevel_desc, itpitems.bandgrade_desc, itpitems.category_code, itprank.overall_ranking, itpitnam.name AS artist, itpitnam.type_code 
    FROM itpitems 
    INNER JOIN itprank ON ( itprank.item_number = itpitems.identifier ) 
    INNER JOIN itpitnam ON ( itpitems.identifier = itpitnam.item_number ) 
    WHERE mainprice >1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: I will leave this here as an example. Read the comments for more
I really hate having to result to this, but this problem has me on
I need the form that will edit the array of entities and their related
I am making an activity that will edit the shared preferences just when the
I would like to write a script which will edit multiple XML files, I
( Late edit: This question will hopefully be obsolete when Java 7 comes, because
I am trying to implement a control to edit text that will display the
My current solution will suck sometimes EDIT For those who don't understand,see this example:
I have a function that will allow me to edit the manager property of
Edit Make sure you don't juxtapose the request and response objects. things will be

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.