today:
642
yesterday:
1,155
Total:
1,131,812
If you want to use EXISTS in a PL/SQL function returning BOOLEAN,try this
DECLARE
  v_exist NUMBER;
BEGIN

SELECT 1 
INTO v_exist
FROM DUAL WHERE EXISTS (select id_referencia 
                                 from items
                                 where id_referencia = :P2_REFERENCIA)

  IF v_exist IS NOT NULL
  THEN
    RETURN true;
  ELSE
    RETURN false;
  END IF;
END;