Advertisement
Weslei_Ramos

Untitled

Mar 9th, 2022
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. CREATE OR REPLACE FUNCTION mostrar_media_salarios_funcionarios()
  2. RETURNS SETOF numeric as $$
  3. BEGIN
  4. RETURN QUERY
  5. SELECT
  6. AVG(C.salariocargo)
  7. FROM
  8. tabelafuncionario as F
  9.  
  10. INNER JOIN tabelafuncionariocargo as FC
  11. ON FC.fkcpffuncionario = F.pkcpffuncionario
  12.  
  13. INNER JOIN tabelacargo as C
  14. ON C.pkcodigocargo = FC.fkcodigocargo;
  15.  
  16. END $$ LANGUAGE plpgsql;
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement