today:
243
yesterday:
251
Total:
1,112,177
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;