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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:54:42+00:00 2026-06-17T21:54:42+00:00

When running this SQL query it returns each Find_ID four times, how can I

  • 0

When running this SQL query it returns each Find_ID four times, how can I make it only select unique finds?

SELECT A.FIND_ID, B.NAME, PERIOD
FROM FINDS A, CLASS B
WHERE A.X >= 4
AND A.X <= 10
AND A.Y >= 4
AND A.Y <= 10
AND FIND_ID = DISTINCT

This returns

FIND_ID NAME                 PERIOD
========== ==================== ====================
         2 SHARD                BRONZE
         5 SHARD                BRONZE
         2 METAL_WORK           IRON_AGE
         5 METAL_WORK           IRON_AGE
         2 FLINT                MESOLITHIC
         5 FLINT                MESOLITHIC
         2 BONE                 RECENT
         5 BONE                 RECENT
  • 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-17T21:54:43+00:00Added an answer on June 17, 2026 at 9:54 pm

    If the two tables FINDS and CLASS are related you need to be using some kind of join (INNER, at a guess). The reason why you are getting four results is that you are running a query that returns the cartesian product of your results – that is, you will get all combinations of both tables joined together without a common field linking the two of them together.

    Here’s an example. Let’s say you have the two really simple tables below:-

    PersonID   Name
    1           Matt
    2           Fred
    
    PersonID   Salary
    1           23000
    2           18000
    

    Then a query like:-

    SELECT * FROM Person, Salary
    

    Would return something like:-

    PersonID  Name  PersonID  Salary
    1         Matt  1         23000
    2         Fred  2         18000
    1         Matt  2         18000
    2         Fred  1         23000
    

    Et voila, four records where you might expect two. Adding DISTINCT to this would achieve nothing, as each of the rows is distinct. To link the related tables you would need something like:-

    SELECT * FROM Person INNER JOIN Salary ON Person.PersonID = Salary.PersonID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an SQL Query that i'm running but I only want to select
Can anyone see what is wrong with this sql query. This returns no results,
I encounter error like this in my sql in running my program, How can
Running this program is printing forked! 7 times. Can someone explain how forked! is
Running this query takes a long time: SELECT host,ip FROM arecords WHERE ip IN
After running this query statement with my database: select * from articles where content
I am running the following SQL query: SELECT * FROM cms_albums WHERE id IN
SELECT * FROM [makes$] WHERE Corporate Name='Champion Enterprises, Inc.' I'm running this query on
I am running the following SQL query, to query my database. Query = SELECT
Need help from you all in writing up this query. Running SQL 2005 Standard

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.