E
E
Ellik2015-11-05 21:02:54
MySQL
Ellik, 2015-11-05 21:02:54

How to merge the selection obtained from JOIN?

I have the following query in the database:

SELECT 
  `prod`.`name`, 
  `prod`.`price`, 
  `atr`.`nameAttribute`, 
  `val`.`attributeValue`
FROM `products` as `prod`
LEFT JOIN `productAttribute` as `atr` ON `prod`.`idProduct` = `atr`.`idProduct`
LEFT JOIN `attributeValue` as `val` ON `atr`.`idAttribute` = `val`.`idAttribute`
WHERE `prod`.`idCategory` = 1

Outputs the following result:
name price nameAttribute attributeValue
ADATA Elite S102 Pro 1p Vendor ADATA
ADATA Elite S102 Pro 1p Elite S102 Pro
Series ADATA Elite S102 Pro 1p Model AS102P-256G-RGY
ADATA Elite S102 Pro 1p Description
ADATA Elite S102 Pro USB Key Fob 1p Capacity Flash -drive 256 GB
ADATA Elite S102 Pro 1r Colors used in design Black
ADATA Elite S102 Pro 1r Dimensions (width x height x depth) 62 x 19 x 11 mm
ADATA Elite S102 Pro 1000r Weight 13 grams
How to create a query that will return the total result of one string? Many thanks in advance for your help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max, 2015-11-05
@Ellik

ok google, mysql concat?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question