¿Necesitas ayuda? envíame un mensaje por WhatsApp!

HASTA 6 CUOTAS SIN INTERÉS EN TODOS NUESTROS PRODUCTOS

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.id desc' at line 1

SELECT p.id, p.nombre, p.thumbs, pd.precio, pd.descuento, m.nombre, pd.stock, pd.id, IF(pd.descuento > 0, pd.descuento, pd.precio) as precio_final, pd.sku, p.fecha_modificacion, (if(pd.descuento > 0, 100 - ((pd.descuento * 100) / pd.precio), 0)) as descuentoMenor FROM productos p join categorias_productos cp on p.id = cp.producto_id join productos_detalles pd on pd.producto_id = p.id join marcas m on m.id = p.marca_id WHERE p.publicado = 1 AND pd.publicado = 1 AND pd.descuento > 0 GROUP BY p.id HAVING precio_final >= login and precio_final <= ORDER BY p.id desc