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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:29:51+00:00 2026-06-17T19:29:51+00:00

I have two tables: Table: AA with columns A, B , C, D Table:

  • 0

I have two tables:
Table: AA with columns A, B , C, D
Table: BB with columns E , F G

I want to get output which is a combination of these two tables like following:

A | B | C | D | E | F | G

I am currently doing following:

Select * from ( 

( select A, B, C ,D from AA where some condition)

UNION ALL

( select E , F , G , NULL from BB where some condition) )

But it is giving me output which contains only A , B , C , D from AA table while it’s not adding E, F , G from table BB.

What am I doing wrong?

  • 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-17T19:29:52+00:00Added an answer on June 17, 2026 at 7:29 pm

    not sure exactly what you idea is , but if you want just plain data from AA and BB in same table display then you can use something like this

     ( select A, B, C ,D, NULL as E, NULL as F, NULL as G from AA where some condition)
    
     UNION ALL
    
    ( select NULL as A , NULL as B, NULL as C, NULL as D, E , F , G  from BB where some condition) )
    

    but not sure what is the point of this 😐

    if you want some combination of data then join is must have.

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

Sidebar

Related Questions

I have two tables. I want to get the UIDs from table 1 where
I have table which has two columns(CAGE,HCC) nulls allowed. I want to display duplicate
I have a really simple table with two rows and two columns. I want
I have a SQL table with only two columns: nameid and name. I want
I have two tables with similar columns - let's say table A with column
I have a table containing two columns in SQL that I want to extract
I have two tables in a database. Table 1 includes an order number which
I have two tables that contain completely separate information: table: tires columns: Tire_id name
i have two tables Table1 with columns user_name,Password and course ID and another table
I have two tables like this: CREATE TABLE table1_lang ( id serial NOT NULL,

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.