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

The Archive Base Latest Questions

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

I have 2 tables like which I would like to query to form a

  • 0

I have 2 tables like which I would like to query to form a new table.

table 1

 number    type serial index 1000001     613      3     1 1000001     613      3     1 1000001     613      3     1 1000001     613      3     1 1000001     613      4     1 1000001     613      3     1 

table 2

 number    type serial index 1000001     613      3     2 1000001     613      3     3 1000001     613      3     4 1000001     613      3     4 1000001     613      4     2 1000001     613      3     1 

I am looking for a query which gives a resultant of indexes and numbers like this, and adds the index, and gives the result:

output table   number  index 1000001      3 1000001      4  1000001      5  1000001      5  1000001      3 1000001      2  

I want to prevent cross joins here. I can’t use where clause because the numbers are same in both tables only the index varies. How can I execute this one-to-one and not one-to-many.

  • 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. 2026-05-11T05:31:49+00:00Added an answer on May 11, 2026 at 5:31 am

    I don’t think it’s possible to do what you are asking. You would have to be able to distinguish each row uniquely to guarantee a 1-to-1 result (this is normally the job of your index column or ID column).

    You might be able to jerry-rig something with rownum, however, if the tables are identically ordered, then perhaps you’ve over-normalised. Table 1 and 2 should really just be one, and you have two index columns (index1 and index2) in the one table.

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

Sidebar

Related Questions

I have 2 tables which in simplified form look like this: Products( id: int,
I have two tables which looks something like this Table Queue int ID; string
I have a couple of tables which look like this Table 1 user_id |
I have this mysql table called comments which looks like this: commentID parentID type
I would like to generate a table (or query result) in this form +---------------------+---------------------+
I would like to form an SQL query to achieve the following: I have
I have two tables which i would like to turn into one in a
i have a table (tbl_world) which look like this id | first_name | last_name
I have a table which looks like this: <table id='t'> <thead> .... </thead> <tbody
I have a table in a DB (Postgres based), which acts like a superclass

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.