Created
January 8, 2015 07:54
-
-
Save kazuhisa/5698e62353d931c0dbcb 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
sql := 'SELECT count(*) FROM mytable WHERE inserted_by = $1' | |
IF checked_date <> null | |
sql := sql + 'AND inserted <= $2' | |
END IF | |
EXECUTE sql | |
INTO c | |
USING checked_user, checked_date; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment