Display Results Replied

0

Good evening, I'm creating an indication system, But the query result does not return users with zero statements

Here's my select

  SELECT 
   c.id, 
   c.nome, 
   funcao, 
   area, 
   count(p.cpf_cli) AS quantidade 
FROM col c 
LEFT JOIN indicacao p 
   ON p.id_colaborador = c.id 
WHERE 
   indicacao.data_ind BETWEEN '2018/09/20' AND '2018/09/21'
GROUP BY 
   c.id, c.nome 
ORDER BY
   c.nome
    
asked by anonymous 05.10.2018 / 03:46

1 answer

0

Hello, good evening. Do as follows that will work, abçs:

SELECT    c.id,    c.name,    Function,    area,    count (p.cpf_cli) AS quantity From col c LEFT JOIN indication p    ON p.id_colaborator = c.id ONDE    date_format (indication_data_ind, "% Y% m% d") BETWEEN '20180920' AND '20180921' GROUP BY    c.id, c.name ORDER BY    c.name

    
05.10.2018 / 04:26