Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Institutional Coding
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AG Bibliometrie
Institutional Coding
Commits
7e0ab78c
Commit
7e0ab78c
authored
5 months ago
by
Christopher Lenke
Browse files
Options
Downloads
Patches
Plain Diff
Lösche is_hi_in_date_pg_int8__date__date_.txt
parent
b5a89da4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Functions/is_hi_in_date_pg_int8__date__date_.txt
+0
-43
0 additions, 43 deletions
Functions/is_hi_in_date_pg_int8__date__date_.txt
with
0 additions
and
43 deletions
Functions/is_hi_in_date_pg_int8__date__date_.txt
deleted
100644 → 0
+
0
−
43
View file @
b5a89da4
-- DROP FUNCTION schema_xyz.is_hi_in_date_pg(int8, date, date);
CREATE OR REPLACE FUNCTION schema_xyz.is_hi_in_date_pg(my_uid bigint, my_first_date date, my_last_date date)
RETURNS bigint
LANGUAGE plpgsql
AS $function$
DECLARE
ergebnis bigint;
BEGIN
select count(*) into ergebnis
from schema_xyz.relation where uid_1=my_uid and uid_0=0
and type in (0,1)
--and ((extract(year from first_date) <= my_first_year and extract(year from last_date) > my_first_year)
--or (extract(year from first_date) < my_last_year and extract(year from last_date) >= my_last_year));
and ((first_date >= my_first_date and first_date <= my_last_date)
or (last_date >= my_first_date and last_date <= my_last_date)
or (first_date <= my_first_date and last_date >= my_last_date)
);
/*
if my_first_year=my_last_year then
select count(*) into ergebnis
from relation where uid_1=my_uid and uid_0=0
and type in (0,1)
and ((extract(year from first_date) = my_first_year and extract(year from last_date) = my_last_year));
end if;
*/
if ergebnis >0 then ergebnis:=1;
else ergebnis:=0;
end if;
RETURN ergebnis;
end;
$function$
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment