Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
CALCULATOR USING PL/PGSQL FUNCTIONS
CREATE OR REPLACE FUNCTION cal( a NUMERIC, b NUMERIC, c NUMERIC, OUT summ NUMERIC, OUT diff NUMERIC, OUT mul NUMERIC, OUT div NUMERIC, OUT mod NUMERIC, OUT pow NUMERIC, OUT hi NUMERIC, OUT lo NUMERIC ) RETURNS record AS $$ BEGIN summ :=a+b+c; diff:=c-b-a; mul :=c*b*a; div :=c/b; mod :=c%a; pow :=POWER(a,2); hi := GREATEST(a,b,c); lo := LEAST(a,b,c); END; $$ LANGUAGE plpgsql; select * from cal(10,20,30)
run
|
edit
|
history
|
help
0
Final 2
test
testo
book suggestion
75 95
Full text search
SQL social network practice by Han Wang 20200720 - 2
Atuação
PostgreSQL pivot using temp view
cte