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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:14:09+00:00 2026-06-14T03:14:09+00:00

I have three tables, A , B , and C . They all hold

  • 0

I have three tables, A, B, and C. They all hold different data, but have some columns in common.

If A, B, and C all have columns C1 and C2 then how can I look up a specific C2 value using a C1 value that could be in any of the 3 tables?

Basically, I want to do a simple look-up but have it act on the union of the 3 tables – and I’d prefer to not use a view to achieve this.

Note that this is an Ingres Vectorwise database.

  • 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-14T03:14:10+00:00Added an answer on June 14, 2026 at 3:14 am

    You do this by doing a union of the tables in the from clause:

    select c2
    from ((select c1, c2 from a) union all
          (select c1, c2 from b) union all
          (select c1, c2 from c)
         ) t
    where c1 = <your value>
    

    I’ve used union all for performance reasons. If you are concerned about duplicate values, either use union or add a distinct in the select.

    This is standard SQL and should work in any database.

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

Sidebar

Related Questions

I have three tables with 5 columns each. They can grow upto 15 rows
I have three different applications, they all share the ASP.NET membership aspect of the
I have three tables and they look like this: users_table categories_table depart_table u_id cid
I have three tables, I don't know if they all need to be used,
i have three tables, i want to select all data from one of the
I have four tables. Three of them are tables with one key and they
I have three tables. I have to retrieve the data using Linq statement. My
I have three tables of data: table: cars [10,000 rows] table: planes [2,000 rows]
I have three tables in oracle db as newitems, itemdetails, ticketitems table. Some dummy
We have three tables to hold our products and keywords: Product {int ID, string

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.