I wrote this select:
SELECT
nvl(SUM(vl_item),0) AS SUM_VALOR_ITENS
,nvl(SUM(vl_discount),0) AS SUM_VALOR_DESCONTO
,nvl(SUM(qty_item) is null ,0,0) AS SUM_QTD_ITENS
,COUNT(DISTINCT cod_product_rms) AS QTD_ITENS_UNICOS
FROM db.my_table
where SAFRA = 202006
When I ran on DBeaver, the result was 0 (zero), like I expected. But, the result when I ran this SQL in a HQL file using Java was "0E-10", "0E-18" and "0E-18" respectively. I don't understand why I received this result. Somebody can help me?