Skip to content

Commit

Permalink
child view sql changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Sep 27, 2021
1 parent a2bbdda commit 3392d86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inst/dbfunctions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ AS $func$
WITH t1 AS (
SELECT id, row_number() OVER () AS orderid
FROM (
SELECT id, ordervalue, CASE _orderprop WHEN 'desc' THEN -row_number() OVER () ELSE row_number() OVER () END AS orderid
SELECT id, ordervalue, CASE _orderby WHEN 'desc' THEN -row_number() OVER () ELSE row_number() OVER () END AS orderid
FROM (
SELECT
r1.id,
Expand Down Expand Up @@ -374,8 +374,8 @@ AS $func$
GROUP BY 1, 2, 3, 4
) t4
JOIN metadata m5 ON t4.id = m5.id AND m5.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasAvailableDate'
JOIN relations r2 ON t4.id = r2.id AND r2.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasAccessRestriction'
JOIN metadata mr2 ON r2.target_id = mr2.id AND mr2.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasTitle'
LEFT JOIN relations r2 ON t4.id = r2.id AND r2.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasAccessRestriction'
LEFT JOIN metadata mr2 ON r2.target_id = mr2.id AND mr2.property = 'https://vocabs.acdh.oeaw.ac.at/schema#hasTitle'
GROUP BY 1, 2, 3, 4, 5, 6, 7
) t
$func$
Expand Down

0 comments on commit 3392d86

Please sign in to comment.