Answer the question
In order to leave comments, you need to log in
Duplicate data with multiple Left Join (Cartesian product), how to remove?
Hi all!
For the 2nd day I have been slowly approaching this request, but it still does not give in.
There is a request for obtaining data from 3 tables.
-Product -Characteristics
table 1 -Characteristics table
2
SELECT
tx_carmodels.vendor as vendor,
tx_carmodels.model as model,
tx_carmodels.year as year,
tx_carmodels.modification as modification,
tx_tyrespecifications.front_width as tyre_front_width,
tx_tyrespecifications.front_diameter as tyre_front_diameter,
tx_wheelspecifications.front_width as wheel_front_width,
tx_wheelspecifications.front_diameter as wheel_front_diameter
FROM
tx_carmodels
LEFT JOIN tx_tyrespecifications ON tx_tyrespecifications.carmodel = tx_carmodels.id
LEFT JOIN tx_wheelspecifications ON tx_wheelspecifications.carmodel = tx_carmodels.id
WHERE
tx_carmodels.vendor_url = 'kia'
AND tx_carmodels.model_url = 'rio'
AND tx_carmodels.modification_url = '16i-jb'
Answer the question
In order to leave comments, you need to log in
You do not have any duplicates, most likely in the tx_tyrespecifications and tx_wheelspecifications tables there is more than one characteristic for the selected model.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question