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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:09:24+00:00 2026-06-18T09:09:24+00:00

Can I realise something like it? For example if some other field value is

  • 0

Can I realise something like it? For example if some other field value is ‘a’, foreign key should be to table a, if value is ‘b’, it should be key to table b? I understand that it is not normal and doesn’t match idea of foreign keys, but is it possible to do something to make this scheme real in fact?

Update :

I have a schema like this:

There are products. They can contain different additional fields, for example standart product can content no additional fields, but “picture” can contain fields like “author” and so on. Really “standart product” and “picture” can differ ideologically, not only because of additional fields.

There is table like “Order”, that should contain link to product and other data. But when I put field like “product id”, it should be data, is it standart product id, or picture id.

There can be design like table of additional fields, but there will be another problem. I can make table(id, additional_field_name) and table for mapping (id, add_field_id, product_id, field_value), but field_value can be number and can be string, so this idea is not good I think.

  • 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-18T09:09:25+00:00Added an answer on June 18, 2026 at 9:09 am

    Per your comment & revised question:

    Products

    ID
    Description
    AdditionalFields_ID
    

    Additional Fields

    AdditionalFields_ID
    Author
    

    Then use a LEFT JOIN, so that your query only pulls additional fields when they exist (like when the product type is a picture).

    SELECT *
    FROM Products P LEFT JOIN AdditionalFields A ON P.AdditionalFields_ID = A.AdditionalFields_ID
    

    If you want a better answer than that, you’re going to have to provide some real examples of your table structure & data in your question.

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

Sidebar

Related Questions

I realise that you can open the google maps app ready for directions by
I'd like to write a small JavaScript (framework) that can chain functions with all
If I understand correctly Clojure can return lists (as in other Lisps) but also
I was wondering how I can realize with jQuery the simple example in the
How can you realize the usage of JNDI , with an example if possible?
I realize that it can depend on certain things (and obviously how efficient the
I realize that I need to use a mailserver so people can contact me,
Can anyone let me know how can we change the value of kendo combobox
I'm looking for an editor/IDE that can provide features that are nice to have
Firstly, I realise that this is a very similar question to this one: Which

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.