I need to make a select in the bank using sum and distinct. I tried this:
SELECT DISTINCT 'conta_idconta', SUM(valor) AS ValorTotal FROM contaSaida WHERE conta_empresa_idempresa=1 AND conta_subcategoria_idsubcategoria=4 AND data BETWEEN 2017-03-06 AND 2018-03-06
but returns me NULL
Tablecontents: