Skip to content

Commit

Permalink
distinct added to child view sql
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Aug 31, 2020
1 parent 7de4f70 commit cb3d319
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions inst/dbfunctions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ CASE WHEN _orderby = 'asc' then
CREATE TEMP TABLE child_ids AS(
WITH ids AS (
select
r.id,
COALESCE(
DISTINCT(r.id),
COALESCE(
(select mv.value from metadata_view as mv where mv.id = r.id and mv.property = _orderprop and mv.lang = _lang limit 1),
(select mv.value from metadata_view as mv where mv.id = r.id and mv.property = _orderprop and mv.lang = _lang2 limit 1),
(select mv.value from metadata_view as mv where mv.id = r.id and mv.property = _orderprop limit 1)
Expand Down Expand Up @@ -351,8 +351,8 @@ ELSE
CREATE TEMP TABLE child_ids AS(
WITH ids AS (
select
r.id,
COALESCE(
DISTINCT(r.id),
COALESCE(
(select mv.value from metadata_view as mv where mv.id = r.id and mv.property = _orderprop and mv.lang = _lang limit 1),
(select mv.value from metadata_view as mv where mv.id = r.id and mv.property = _orderprop and mv.lang = _lang2 limit 1),
(select mv.value from metadata_view as mv where mv.id = r.id and mv.property = _orderprop limit 1)
Expand Down

0 comments on commit cb3d319

Please sign in to comment.