Created
May 23, 2020 17:09
-
-
Save programisti/6eccd9ac5e87b5af7489015e0eb47441 to your computer and use it in GitHub Desktop.
This file contains 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
-- FUNCTION: api.search_job(character varying, integer, integer, integer) | |
-- DROP FUNCTION api.search_job(character varying, integer, integer, integer); | |
CREATE OR REPLACE FUNCTION api.search_job( | |
keyword character varying, | |
rategt integer, | |
ratelt integer, | |
session integer) | |
RETURNS api.job | |
LANGUAGE 'sql' | |
COST 100 | |
STABLE SECURITY DEFINER | |
AS $BODY$ | |
SELECT * FROM api.job | |
WHERE | |
(title LIKE '%' || keyword || '%' or text LIKE '%'|| keyword ||'%') and | |
session = session and | |
rate >= rateGt and | |
rate <= rateLt and | |
status = 'active'; | |
$BODY$; | |
ALTER FUNCTION api.search_job(character varying, integer, integer, integer) | |
OWNER TO postgres; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment