SHARE
TWEET

Cadastros Iniciados e Efetivados

a guest May 29th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  SELECT
  2. EXTRACT(YEAR FROM p.REGISTRATIONDATE) ano
  3. , EXTRACT(MONTH FROM p.REGISTRATIONDATE) mes
  4. , COUNT(1) AS COUNTSTARTEDREGISTRATION
  5. , SUM(
  6.           CASE WHEN P.REGISTRATIONSTATUS IN ('COMPLETE', 'APPROVED', 'BACKOFFICE_PENDING', 'REFUSED', 'DOCUMENTSPICTURES_BACK') THEN 1 ELSE 0 END
  7.         ) AS COUNTCOMPLETEREGISTRATION
  8.     FROM TUDOPROD.PERSON p
  9.     WHERE EXTRACT(YEAR FROM p.REGISTRATIONDATE) = 2019
  10. AND (P.REGISTRATIONSTATUS IS NOT NULL OR P.REGISTRATIONSTATUS != 'OPENED')
  11. GROUP BY EXTRACT(YEAR FROM p.REGISTRATIONDATE)
  12. , EXTRACT(MONTH FROM p.REGISTRATIONDATE)
  13. ORDER BY 1;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top