jueves, 12 de noviembre de 2020

Show many values in a single column using PostgreSQL

 SELECT
    f.c_invoice_id AS id_factura,
    f.dateacct AS fecha_documento,
    list_horizontal(p."name") AS productos
FROM c_invoice f
    JOIN c_invoiceline df
    ON f.c_invoice_id = df.c_invoice_id
    JOIN m_product AS p
    ON df.m_product_id = p.m_product_id
WHERE f.ad_client_id = 1000000
    AND f.docstatus = 'CO'
    AND f.dateacct BETWEEN '20201001' AND '20201112'
GROUP BY
    f.c_invoice_id,
    f.dateacct;

 


 

No hay comentarios:

Publicar un comentario