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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:57:19+00:00 2026-05-26T00:57:19+00:00

This is driving me nuts, I’m sure it’s rather simple but can’t get it

  • 0

This is driving me nuts, I’m sure it’s rather simple but can’t get it right.

Having a table holding ratevalues for different years:

Ratevaluetable

Year   Value A  Value B  Value C
2009     10      15       20
2010     12      18       22
2011     14      21       25

Then I have another persontable:

User    Time      Price
john    2010      value B
Tina    2009      Value C
Bill    2011      Value C

Now what I need is to join the 2 tables so that I get the value in the Price column substituted with the data from the Ratevaluetable.

I can join on time on year, but the I don’t know how to join to the Value fields?

  • 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-05-26T00:57:19+00:00Added an answer on May 26, 2026 at 12:57 am

    This is not possible with your current database schema. Joins connect tables by matching column values; what you propose to do here is match a column value with a column name, which is impossible.

    What would be possible is:

    Table ValueTypes:
    Id    Description
    1     Value A
    2     Value B
    3     Value C
    
    Table RateValueTable:
    Year     ValueTypeId     Value
    2009     1               10
    2009     2               15
    2009     3               20
    
    Table User:
    User    Time      ValueTypeId
    john    2009      2
    

    Given the above schema, you could join User to RateValueTable in the obvious manner.

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

Sidebar

Related Questions

This is driving me nuts. I can't seem to get the data template within
OK, this is driving me nuts. I'm sure it is trivial, but I've been
This is driving me nuts. I believe I asked this exact same question, but
This is driving me nuts. I've looked at all the relevant MSDN tutorials but
Ok, this is driving me nuts. I've done just about everything I can to
So this is driving me nuts. I need to pull my table rows from
This is driving me nuts!@#!@# I can load the tinyMce plugin for jquery just
This is driving me nuts! I am getting the classic Can't connect to local
I don't know why this is driving me nuts but it is. I have
This is driving me nuts. I have a simple spring app with just a

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.