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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:01:00+00:00 2026-05-24T01:01:00+00:00

I am working on a price comparison program. I have three websites. In my

  • 0

I am working on a price comparison program. I have three websites. In my database I have three tables for the webshops. Each tables has a price and a product_id column. I want to list all the product_id-s and see the prices in every webshop. The product id is unique, but not the same in all of the tables, as not all webshop has the same products. I am working with mysql, but I’m very new to databases. What query should I try?

  • 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-24T01:01:02+00:00Added an answer on May 24, 2026 at 1:01 am

    I suggest you have a “master” product table, that lists all products, regardless of whether they are sold on all sites, or just one. Then join from that to each of the website pricing tables. Try matching on product name. In its simplest form, the query wold look like:

    select
      p.*,
      t1.price as site1_price,
      t2.price as site2_price,
      t3.price as site3_price
    from product p
    left join website1 t1 on t1.name = p.name
    left join website2 t2 on t2.name = p.name
    left join website2 t3 on t3.name = p.name;
    

    You might have to try joining on brand and model, ie on t1.brand = p.brand and t1.model = p.model, or some other criteria if name is not unique.

    site prices will be null if they don’t sell a product.

    To quickly populate product, you could run this:

    insert into product (name, brand, model, ...)
    select name, brand, model, ... from website1
    union 
    select name, brand, model, ... from website2
    union 
    select name, brand, model, ... from website3;
    

    FYI, the use of UNION (rather than UNION ALL) makes the output of the union produce only unique rows

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

Sidebar

Related Questions

I am working on a codeigniter site, the client has requested that the price
Supposingly I am working on one of my options in my program. I have
I am working with price data for futures contracts. I have data for Dec.
I am working on a price list management program for my business in C#
I am working on a database that contains 3 tables: A list of companies
Im working with Rails 3.0.3 I want to create bills in my App. Each
Here's the XML code I'm working with: <inventory> <drink> <lemonade supplier=mother id=1> <price>$2.50</price> <amount>20</amount>
Working on a project at the moment and we have to implement soft deletion
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
I'm working with Depot tutorial, I'm having an issue when defining total price: this

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.