SELECT SUM(SUMA) AS SUMA from imp_import_documente where extract(year from dat_document) = 2024 and extract(month from dat_document) = 6 
AND SUBSTR(SCD, 1,3) = '401';
SELECT SUM(SUMA) AS SUMA from imp_import_documente where extract(year from dat_document) = 2024 and extract(month from dat_document) = 6 
AND SUBSTR(SCC, 1,3) = '401';

SELECT sum(t.suma) as suma, dat_document from imp_import_documente t where extract(year from dat_document) = 2024 and extract(month from dat_document) = 6 AND SUBSTR(SCD, 1,3) = '401' group by dat_document order by dat_DOCUMENT;
SELECT sum(t.suma) as suma, dataact from ACT t where AN=2024 AND LUNA = 6 AND SUBSTR(SCD, 1,3) = '401' AND STERS= 0 group by dataact order by dataact;

select t.*,rowid from imp_import_documente t where extract(year from dat_document) = 2024 and extract(month from dat_document) = 6 AND SUBSTR(SCD, 1,3) = '401' AND dat_document = to_date('04062024', 'ddmmyyyy')order by dat_document, suma;
select t.*,rowid from act t where AN=2024 AND LUNA = 6 AND SUBSTR(SCD, 1,3) = '401' AND STERS= 0  AND dataact = to_date('04062024', 'ddmmyyyy')order by dataact, NRACT, suma;
