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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:15:20+00:00 2026-05-23T13:15:20+00:00

I have two tables which I need to join. First Table: EFF_DATE RATE CURRENCY

  • 0

I have two tables which I need to join.

First Table:

EFF_DATE     RATE   CURRENCY
20110101     1.286  USD
20110201     1.275  USD
20110301     1.275  USD
20110401     1.260  USD
20110501     1.225  USD

2nd Table:

PO_NO   TRANS_DATE  ACCT_DATE   SUPP_NO CURRENCY     LOCAL_AMT 
1000068 20110114    20110115    S016    USD          16,500.00 
1000070 20110214    20110215    S016    USD           7,660.00 
1000072 20110317    20110322    S025    USD           1,080.00 
1000132 20110314    20110315    S037    USD           3,500.00 
1000133 20110414    20110415    S038    USD          14,500.00 

Based on ACCT_DATE, I wish to add RATE column & the result should look like this:

PO_NO   TRANS_DATE  ACCT_DATE   SUPP_NO CURRENCY     LOCAL_AMT  RATE
1000068 20110114    20110115    S016    USD          16,500.00  1.286
1000070 20110214    20110215    S016    USD           7,660.00  1.275
1000072 20110317    20110322    S025    USD           1,080.00  1.275
1000132 20110314    20110315    S037    USD           3,500.00  1.275
1000133 20110414    20110415    S038    USD          14,500.00  1.26
1000170 20110531    20110531    S016    USD          15,400.00  1.225

How can I achieve this by using SQL? Thanks!

  • 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-23T13:15:20+00:00Added an answer on May 23, 2026 at 1:15 pm

    In MySQL you would do something like:

    SELECT st.*, ft.rate FROM second_table st LEFT JOIN first_table ft ON (MONTH(acct_date) = MONTH(eff_date) AND YEAR(acct_date) = YEAR(eff_date) )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help formulating this query. I have two (relevant) tables, which I
I have two HTML tables which would ideally be placed side by side on
Hi I want to have two tables each have an INT id column which
I have a table y Which has two columns a and b Entries are:
I have a two-dimensional array (of Strings) which make up my data table (of
I have two tables, both with start time and end time fields. I need
I've got two un-related (no FK's defined) tables. The first table contains some tasks
I have two tables that are joined together. A has many B Normally you
I have two tables, Book and Tag , and books are tagged using the
We have two Tables: Document: id, title, document_type_id, showon_id DocumentType: id, name Relationship: DocumentType

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.