Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
545 B
1
Indexable
Never
        SELECT 
        xfr.no, 
        trim(xprd.prdno) AS prdno,
        TRIM(SUBSTRING_INDEX(auxChar1,' ',-1)) AS loja,
        xprd.grade, 
        trim(xprd.qtty) AS qtd, 
        trim(xprd.name) AS name, 
        GROUP_CONCAT(trim(prdbar.barcode)) AS barcodes 
        FROM sqldados.xfr 
        INNER JOIN sqldados.xprd ON xfr.no = xprd.xfrno 
        LEFT JOIN sqldados.prdbar ON xprd.prdno = prdbar.prdno AND xprd.grade = prdbar.grade 
        WHERE xfr.no = :requisition
        GROUP BY xfr.no,prdbar.prdno, prdbar.grade;
Leave a Comment