Proper Reports in Dolibarr

Products with Country of Origin (Manufacturing Country) (highest first, ignoring blanks)

SELECT 
    llx_product.fk_country AS 'Country Code',
    llx_c_country.label AS 'Country',
    COUNT(*) AS 'Number of Products'
FROM
    llx_product
        INNER JOIN
    llx_c_country ON llx_product.fk_country = llx_c_country.rowid
GROUP BY fk_country
ORDER BY COUNT(*) DESC;
1 Like