Skip to content

Instantly share code, notes, and snippets.

@arbo-hacker
Last active February 19, 2016 05:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save arbo-hacker/8b0a52724da6b7854a77 to your computer and use it in GitHub Desktop.
Clausula With | Novedades Oracle 12c
-- Para leer explicación ir a http://arbo.com.ve/2016/02/19/sentencia-with-novedades-oracle-12c/
WITH
FUNCTION sumar(valor1 in number, valor2 in number) RETURN number IS
BEGIN
RETURN valor1 + valor2;
END;
SELECT sumar(a,b) suma from (
SELECT 23 a, 51 b from dual
UNION ALL
SELECT 87 a, 21 b from dual
UNION ALL
SELECT 123 a, 45343 b from dual
) temp;
-- Resultados
-- SUMA
-- -----
-- 74
-- 108
-- 45466
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment