Created
February 25, 2018 16:33
-
-
Save vithalsamp/68b21bdcb8dce9051ae77b5ecc1da9f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace function udf_sql_bignum (float, float) | |
returns float | |
stable | |
as $$ | |
select case when $1 > $2 then $1 | |
else $2 | |
end | |
$$ language sql; | |
--You can just call UDF as if you are calling built-in functions: | |
training=# select udf_sql_bignum(10.3,100.2); | |
udf_sql_bignum | |
---------------- | |
100.2 | |
(1 row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment