daily pastebin goal
54%
SHARE
TWEET

Servidores até 45 anos

delrick-oliveira Feb 19th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.  
  3.     Nome AS "SERVIDOR",
  4.     Funcional->CargoEfetivo->Descricao AS "CARGO",
  5.     Funcional->DataIngOrgaoFormatada AS "DT. ING.",
  6.         Financeiro->DataDesligamento AS "DESLIG",
  7.         Funcional->TipoServidor->descricao,
  8.         DATEDIFF(YEAR, PESSOA->datanascimento, CAST((:p1 || '-12-31') AS DATE )) AS "IDADE P.REF",
  9.     COUNT('QTD') AS "QTD"
  10.  
  11. FROM RHCadServidor
  12.  
  13. WHERE
  14.     ( Funcional->TipoServidor->Codigo IN (1, 2, 3, 5, 11, 20, 26, 27))
  15.     AND ( Funcional->DataIngOrgao <= CAST((:p1 || '-12-31') AS DATE ))
  16.     AND (
  17.             ( Financeiro->DataDesligamento IS NULL )
  18.             OR
  19.             ( Financeiro->DataDesligamento > CAST((:p1 || '-12-31') AS DATE )))
  20.             AND DATEDIFF(YEAR, PESSOA->datanascimento, CAST((:p1 || '-12-31') AS DATE )) <= 45
  21.         AND (FUNCIONAL->LOTACAOEXERCICIO->CODIGO NOT IN (200360,200373,200378,200386,200387, 200388, 200359))
  22.  
  23.  
  24. ORDER BY
  25.     FUNCIONAL->TIPOSERVIDOR->DESCRICAO,
  26.     Nome
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
 
Top