-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added All Downloads and All Users columns
- Loading branch information
worthink
committed
May 8, 2018
1 parent
c2ba443
commit 1659622
Showing
4 changed files
with
77 additions
and
14 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Select COUNT(*) as total from guestbookresponse | ||
where downloadtype like '%ownload%' and dataset_id = {object_id} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
WITH RECURSIVE tree(child, root) AS ( | ||
SELECT c.id, c.owner_id | ||
FROM dvobject c | ||
LEFT JOIN dvobject p ON c.owner_id = p.id | ||
WHERE p.id = {object_id} | ||
UNION | ||
SELECT id,root | ||
FROM tree | ||
INNER JOIN dvobject on tree.child = dvobject.owner_id | ||
) | ||
select count(downloadtype) | ||
from guestbookresponse | ||
join dvobject on dvobject.id = guestbookresponse.datafile_id | ||
where dataset_id IN (SELECT child FROM tree) | ||
and dvobject.publicationdate is not null; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select COUNT(*) as total | ||
from authenticateduser | ||
where affiliation = '{affiliation}' |