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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:53:35+00:00 2026-05-26T04:53:35+00:00

I have for example, the following data in my database table… 30 Miles DVD

  • 0

I have for example, the following data in my database table…

30 Miles DVD
300
310 To Yuma BluRay
310 To Yuma DVD 2007
310 To Yuma DVD Wide Screen
310 To YumaYoung Guns DVD
4 Collection Fights King Of The Cage DVD
48 Hours DVD Wide Screen
49th Parallel DVD
55 Days at Peking DVD
5th Commandment DVD
6th Day BluRay
6th Day DVD 2000
6th Day The Last Action Hero Box Set DVD
7 Men From Now
7 Seconds Sell Through DVD
7 Seconds UMD Mini for PSP 2005
7 Star Grand Mantis DVD
8 Strikes Of The Wildcat DVD
800 Bullets DVD
83 Hours Til Dawn DVD
9 And A Half Ninjas DVD

What I want to display is the UNIQUE titles, so, most of the above are OK but where we have:

310 To Yuma BluRay
310 To Yuma DVD 2007
310 To Yuma DVD Wide Screen

I only want to show, if possible:

310 To Yuma BluRay

again from the above list where there is

6th Day BluRay
6th Day DVD 2000
6th Day The Last Action Hero Box Set DVD

I only want to show:

6th Day BluRay

Or better still “310 To Yuma” && “6th Day” respectively.

I’m thinking I need to maybe do a check on a number of letters in first word before a space then if that’s over say 5 letters match with the next rows, if it does then keep adding the rows to a list somehow then when it stops matching spit out the shortest one? If the first word is less than 5 letters then move onto second word (just trying to avoid, the :: them :: this :: their etc etc)

Another way of saying it: If the first 5 characters (obv. to include spaces) match, once they stop matching get rid of what’s left and print the result. Now, I also have to be careful once again with this as “The Hangover” && “The Hangover 2” are refectly plausible!

One answer suggested on an earlier version of this question was:

SELECT `title` FROM `PRprod_FILMS` m
  WHERE `genre` = 'Action  Adventure'
    AND NOT EXISTS (
      SELECT 1 FROM `PRprod_FILMS` m2
        WHERE m.`title` LIKE CONCAT(m2.`title`, '%')
          AND LENGTH(m2.`title`) < LENGTH(m.`title`)
          AND m2.`genre` = m.`genre`
    )
;

Which kind of works but strips out some unique titles anyway so not the right answer
I wonder if this is even possible or am I asking too much or need to rethink the strategy/logic?

Darren

  • 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-26T04:53:36+00:00Added an answer on May 26, 2026 at 4:53 am

    There is no 100% good solution for this that will never show duplicates or will not remove good records. However my solution would be to search for some common words (DVD, Bluray, PSP, etc) strip everything after that and make that unique. If you do this a lot, store is in another field:

    SELECT DISTINCT( TRIM(
      LEFT(title,
        IF( LOCATE('DVD', title),
            LOCATE('DVD', title) - 1,
            IF( LOCATE('Bluray', title),
                LOCATE('Bluray', title) - 1,
                999
            )
        )
      )
    )) FROM `PRprod_FILMS`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As a simplified example, I have the following data classes: public class Employee {
I have a data file that looks like the following example. I've added '%'
I have following structure with example data: id season_id title 1 1 Intro 2
I have the following example in a SQL table Cust Group Sales A 1
I have a JTable filled with data of a table of my database (so
I have written the following code snippet to read data from the database :
I have the following code that creates my table. I insert data into it
In my database I have tables that define types for example Table: Publication Types
I have the following database structure: CREATE TABLE LookupTable ( PK UNIQUEIDENTIFIER PRIMARY KEY,
I want to fetch some data from the following database table 'article'. i want

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.