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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:27:26+00:00 2026-05-22T17:27:26+00:00

I have three tables. Table A has the option name (i.e. Color, Size). Table

  • 0

I have three tables. Table A has the option name (i.e. Color, Size). Table B has option value name (i.e Blue, Red, Black, Etc.). Table C establishes the relationship by putting option name id and option name value id together in a row.

My query needs to show the names of the values and and options as opposed to the id number. I can do A and B one at a time and get a list of value and options names, but since the value and options are related I want a combined list. For Example.

Color – Blue
Color – Red
Size – Big
Size – Small

So my question is how to join these two queries to get a combined result like above.

SELECT products_options.products_options_name FROM products_options
LEFT JOIN products_options_values_to_products_options ON products_options_values_to_products_options.products_options_id=products_options.products_options_id

SELECT products_options_values.products_options_values_name FROM products_options_values
LEFT JOIN products_options_values_to_products_options ON products_options_values_to_products_options.products_options_values_id=products_options_values.products_options_values_id
  • 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-22T17:27:27+00:00Added an answer on May 22, 2026 at 5:27 pm

    You need two joins, which will look like this:

    select product_options.product_id,
           option_names.name_id,
           option_names.name,
           option_values.value_id,
           option_values.name
    from product_options
    join option_names using (option_id)
    join option_values using (option_id)
    where product_options.product_id = :product_id
    

    It won’t combine them together for an immediate insert in your variations table, but this is the best you’ll do in MySQL.

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

Sidebar

Related Questions

I have three tables like this: Person table: person_id | name | dob --------------------------------
I have three tables in restaurant search done in php. The search has option
I have two tables one has a three column composite key. The other needs
I have a table that has three different date columns, so I set each
I have a logging table which has three columns. One column is a unique
I have a SqlServer 2008 table which has a Primary Key (IsIdentity=Yes) and three
I have a table column where each row has one of three states, and
I have a table in SQL Server 2005 which has three columns: id (int),
Say I have three tables: Fruit (Table 1) ------ Apple Orange Pear Banana Produce
In a vanilla install of Magento 1.5.1.0 I have created simple products COLOR-RED, COLOR-BLUE

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.