Create a gist now

Instantly share code, notes, and snippets.

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