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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:05:58+00:00 2026-06-15T02:05:58+00:00

I have 2 tables in database: table_1 and table_2 . table_1 contains 3 column

  • 0

I have 2 tables in database: table_1 and table_2.

table_1 contains 3 column namely a_id, a_zone, a_address

table_2 contains 4 column namely p_id, not_use, p_zone, p_address

The row numbers are not same in the 2 tables. I need to compare the “DATA SET” of the (a_zone, a_address) from table_1 with (p_zone, p_address) from table_2.

Let me give you an example:

Table1 contains:

a_zone  a_address
=================
1       8
2       9
3       6
4       9
5       2

Table2 contains:

p_zone  p_address
=================
1       8
2       9
3       6
4       9
5       8

Now I need to compare like this a_zone, a_address = p_zone, p_address or not.

I do not need to compare only a_zone with only p_zone or only a_address with only p_address. Rather, I need to compare the whole data combination. for my above example, I need to compare 18 with 18 [a_zone,a_address WITH p_zone, p_address ]

I’m stuck with it, and really need help. Please suggest me….:)

  • 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-15T02:05:59+00:00Added an answer on June 15, 2026 at 2:05 am

    You haven’t specified what data you wish to return so I have assumed a simple join.

    Unless I am mis understandng your query I do not think that you need a union I think that you can do this with a single join:

    SELECT *
     FROM table_1 JOIN table_2 
     WHERE (table_1.a_zone = table_2.p_zone) && (table_1.a_address = table_2.p_address);
    

    This returns:

    enter image description here

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

Sidebar

Related Questions

I have the following database tables Master Table – Contains PK Id column for
If I have a database table that has one column that contains a regex
I have 2 tables in my database, for example: Table1: id (PK), data1 and
I have two tables in my database table1, table2. I have a join query
I have a database that has two tables, these tables look like this codes
I have a database with a table that contains Name and CompanyName . They
I have a MYSQL database table called 'wp_quotes' with a field that contains a
In my database, I have 3 tables that have 2 similar columns, Year and
I have two tables in a database. Table 1 includes an order number which
I have a SQL Server database table with a column called resources. Each cell

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.