Note that there are some explanatory texts on larger screens.

plurals
  1. PORows results to columns in MySQL Query (prestashop)
    primarykey
    data
    text
    <p>i'm trying to create a MySQL query that'll list the products Attributes on Prestashop together in a single row. (Dont want to depend on paid modules).</p> <p>The current query is:</p> <pre><code>SELECT p.id_product AS 'idProduto', pac.id_attribute, al.name 'Nome_SKU', pa.id_product_attribute as 'idSKU', pl.name AS 'Nome', pl.description_short AS 'Descricao Curta', pl.description AS 'Descricao', pl.meta_title AS 'Meta-Title', pl.meta_keywords AS 'Meta-keyword', pl.meta_description AS 'meta-description', pl.link_rewrite AS 'URL rewrite', pl.available_now AS 'texto_estoque', pl.available_later AS 'texto_indisponivel', pa.quantity as 'Quantidade', p.price 'Preco', pa.minimal_quantity 'Quantidade Minima', p.active AS 'Ativo (0/1)' FROM ps_product p INNER JOIN ps_product_lang pl ON p.id_product = pl.id_product INNER JOIN ps_product_attribute pa ON pl.id_product = pa.id_product INNER JOIN ps_product_attribute_combination pac ON pa.id_product_attribute = pac.id_product_attribute INNER JOIN ps_attribute_lang al ON al.id_attribute = pac.id_attribute where pl.id_lang = 6 AND p.id_product = 101 group by pa.id_product_attribute,al.name </code></pre> <p>And it's results are like this (i.e. id_product 101):</p> <p><img src="https://i.stack.imgur.com/aJJiD.png" alt="enter image description here"></p> <p>What i need is the results to "group" in a same row by their idSKU to show the values (Nome_SKU) each in one column, beeing like this(i.e. idSKU 647):</p> <p><img src="https://i.stack.imgur.com/cFmlD.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload