ventasenlinea@herrerayherrera.cl(+56) 2 2219 8800
Av. Jorge Alessandri Rodríguez 12667, San Bernardo.

herrerayherrera

Error description: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'group by pd.id ORDER BY pp.posicion asc, pd.id DESC' at line 1

SELECT pd.id, pd.nombre, p.id, p.marca_id, MIN(if(pd.descuento > 0, pd.descuento, pd.precio)) as valorMenor FROM productos p JOIN productos_detalles pd ON p.id = pd.producto_id LEFT JOIN posicion_productos pp ON p.id = pp.producto_id LEFT JOIN lineas_productos lp ON p.id = lp.producto_id WHERE p.publicado = 1 AND lp.categoria_id = 68 AND lp.linea_id = group by pd.id ORDER BY pp.posicion asc, pd.id DESC