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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:39:31+00:00 2026-05-26T05:39:31+00:00

I have 2 tables tb1 OLD_id | East | North 1 | 1000 |

  • 0

I have 2 tables

tb1
OLD_id | East | North
1      | 1000 | 2000

tb2
NEW_id | East | North
4000   | 1009 | 1995

For all records in “tb1” I need to find all records from “tb2” that match the following conditions

tb2.East between (tb1.East - 10) and (tb1.East + 10)
tb2.North between (tb1.North - 10) and (tb1.North + 10)

Output

OLD_id | Matching NEW_ID's | East Difference | North Difference
1      | 4000              | 9               | -5
  • 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-26T05:39:32+00:00Added an answer on May 26, 2026 at 5:39 am

    Try this one –

    SELECT t1.OLD_id, t2.new_id `Matching NEW_ID''s`, t2.East - t1.East `East Difference`, t2.North - t1.North `North Difference` FROM tb1 t1
      JOIN tb2 t2
      ON 
        t2.East BETWEEN t1.East - 10 AND t1.East + 10 AND
        t2.North BETWEEN t1.North - 10 AND t1.North + 10
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have tables with more then 3m records. When using innerjoin it is much
I have two tables, tb1(account, status) and tbl2(account status_ex). For example account status 0001
I have tables called: activities and deficiencies . activities table contains all activities registered
I have these schema in my database: Tb1: { Id:int , NameTb1:varchar(50) } Tb2:
I need to cross reference 2 tables. within tb1 is booking_ref, investor within tb2
I have tables A and B with identity PKs ida and idb : ex
I have tables like these two test_table date student test 2012-05-31 Alice Math 2012-05-31
I have tables like this: tblUsers int UserID string UserName tblUsersInRoles int UserID int
I have tables linked by FK, I query on the first table using entity
I have tables named news and tags_news. Given a news id I have to

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.