Created
September 29, 2016 02:40
-
-
Save mydreambei-ai/d31b483b19c830eee280f136bda13821 to your computer and use it in GitHub Desktop.
postgresql custom aggregate function
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 lmy(first INTEGER, item INTEGER) returns INTEGER as $$ | |
BEGIN | |
return first * item; | |
END; | |
$$ | |
LANGUAGE plpgsql; | |
create aggregate yml(INTEGER) ( | |
sfunc = lmy, | |
stype = INTEGER, | |
initcond = 1 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment