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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:52:30+00:00 2026-06-04T15:52:30+00:00

I would like to join data from tables from two databases. One is filed

  • 0

I would like to join data from tables from two databases. One is filed with predefined values (itemId, itemName) and other is filled by user (itemId, itemName, userId). Atributes itemId and itemName are the same, from first table we select all data, from second we select data by userId and combine these two results.

Joined data should be distinguish because ids are autoincrement and could be the same(doubled). We would like to fill drop down list with this data for example with datasource and dictionary (int is itemId, string is itemName) we could only have valueFiled and valueText in dropDownList but ids of these two tables could be the same and lather we don`t know from wich table is item selected by id.

Is there any elegant way to joint this, maybe with temp tables that we always when user is logged in join these two tables in temp table etc…

Thank you for your answers

  • 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-04T15:52:32+00:00Added an answer on June 4, 2026 at 3:52 pm

    I think you’re looking for a union. Use a literal value to identify the source.

    select 'predefined' as source, itemid, itemname
      from predefined_values_table
    union all
    select 'user', itemid, itemname
      from user_supplied_values_table
      where userid = ?;
    

    If you can accommodate only two columns, you might be able to use something like this instead. But you’ll have to undo the string concatenation to get the id number.

    select 'p:' || itemid, itemname
      from predefined_values_table
    union all
    select 'u:' || itemid, itemname
      from user_supplied_values_table
      where userid = ?;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables user and log. I would like to join the user
I am using a simple join to pull data from two databases. This is
I would like to parse the values from aspx pages, both what is passed
I am using ActiveRecord in Rails 3 to pull data from two different tables
I need to copy data from one table to another. The tables do not
tl;dr: I need to show data from two different tables in the list view
I have two IEnumerable<dynamic> of data retrieved from database tables, called FullSet and InScopeSubSet
I have a materialized view of a complex join, which I would like to
I need to store data that looks like this: <root> <child-one> value 1 value
I have two tables on different servers, and I'd like some help finding an

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.