Error group by clause postgresql

Hi i got the following query

select, as variation_id, as Nombre, as Categoria, as Marca, as Impuesto,SUM(COALESCE(vld.qty_available,0)) as Stockactual,MAX(v.sell_price_inc_tax) as PrecioVenta,MIN(v.sell_price_inc_tax) as min_price,MAX(v.dpp_inc_tax) as max_purchase_price,MIN(v.dpp_inc_tax) as min_purchase_price,products.sku as SKU,products.product_custom_field1 as Numeroserie, products.product_custom_field2 as MAC,products.image,products.enable_stock as Estado,units.actual_name as unit,products.enable_stock as enable_stock,products.created_at

FROM products

LEFT JOIN brands b
ON products.brand_id =

JOIN units
ON products.unit_id =

LEFT JOIN categories as c1
ON products.category_id =

LEFT JOIN tax_rates
ON =

JOIN variations as v
ON v.product_id =

LEFT JOIN variation_location_details as vld
ON vld.variation_id =


and this is the error:

*** error:"column "" must appear in the GROUP BY clause or be used in an aggregate function"**

im migrating from mysql to postgresql

Add it to the GROUP BY statement like below


1 Like