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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:39:20+00:00 2026-05-29T22:39:20+00:00

I have a MySQL database I’m searching through. Lets say this is a database

  • 0

I have a MySQL database I’m searching through. Lets say this is a database of people. When querying for a specific record, it is possible to find a match 100% on each attribute. But querying the database to find closest match on probability (closest matches on table attributes) is more of the strategy.

In this scenario, does it make sense to create a temporary table (much like a tally-sheet) to indicate what attributes match/what attributes are present? What is the typical approach to doing advanced searches on database like this?

Example (below) of a hypothetical stored Procedure

*parameters are just to exemplify how I would search. I’m not concerned how to perform my selects. Question is about approach, strategy, technique *

call FindPerson ("Brown Eyes", "Brown hair", "Height:6'1", "white", "Name:Joe" ,"weight180", "Age 34" "sex m");

RESULT TABLE
NAME  AGE HEIGHT WEIGHT HAIR  SKIN  sex  RANK_MATCH
Joe   32  6'1    180    Brown white m    1
Mike  33  6'1    179    Brown white m    2
James 31  6'0    179    Brown black m    3 
  • 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-29T22:39:20+00:00Added an answer on May 29, 2026 at 10:39 pm

    Just out of my mind. You can create your own score and sort by it. Something like

    SELECT `id`,
      (IF(`age`=32,1,0)+IF(`height`="6'1",1,0)+...) as  `score`
    FROM `people`
    HAVING `score` > 0
    ORDER BY `score` DESC
    LIMIT 10;
    

    With this, you can handle every field with its own comparison, and also weight the individual attributes by not just add 1 but 2 or more.
    But I’m quiet not sure, how performant this is.

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

Sidebar

Related Questions

I have this MySQl database that has a table which contains a column that
I have a MySQL database that looks like this: users ( id , name
I have a MySQL database whose keys are of this type: A_10 A_10A A_10B
Hello I have this problem: I have MySQL Database with collation latin1_bin . In
I have a MySQL database with a structure like this... Site has many Sensors
I have a MySQL database with a date_of_birth field. The data stored in this
I have mysql database and I want a software which can draw the database
I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
I have a MySQL database behind a firewall which can only be accessed via
I have a MySQL database table with a couple thousand rows. The table is

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.