Jump to content

Campo SQL categoría de producto sale vacío


SLOT4EVER

Recommended Posts

Hola

Tengo la siguiente SQL que vuelca los clientes con las categorías en las que han hecho alguna compra, lo cual me sirve para segmentar la BBDD para email marketing.

Sin embargo ahora ya no me vuelca el campo Categorías, (aparece vacío)

SAbéis por qué puede ser?

El SQL es

select c.id_customer, c.firstname, c.lastname, c.email, c.date_add as fechaalta, c.newsletter, (select count(o.id_order) as pedidos from ps_orders o where c.id_customer = o.id_customer) as numpedidos, REPLACE((select group_concat(DISTINCT cl.name) from ps_order_detail od, ps_product p, ps_category c, ps_category_lang cl, ps_category_product cp, ps_orders o where c.id_customer = o.id_customer and cp.id_product = od.product_id and cp.id_category = cl.id_category and cl.id_lang = 4 and od.id_order = o.id_order and p.id_product = od.product_id and cl.id_shop=1 and c.id_category = cl.id_category and c.id_parent = 4 group by c.id_customer),'ó','o') as categorias from ps_customer c where c.email not like '%marketplace%' group by c.id_customer

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...