Created
November 30, 2020 19:53
-
-
Save larapollehn/8d26ef93db88f2aa23dc685298bc3e57 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
| Simple exmple of a SQL Function for postgres. The function increments a given int by 1. | |
| CREATE FUNCTION increment (age int) | |
| RETURNS int | |
| LANGUAGE plpgsql | |
| AS $$ | |
| declare | |
| incremented_age int; | |
| BEGIN | |
| incremented_age = age +1; | |
| RETURN incremented_age; | |
| END; | |
| $$; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment