Skip to content

Commit d8db691

Browse files
authored
Designation catatlog on the layer2 (#411)
1 parent e28900e commit d8db691

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

postgres/drafts/06_designation.sql

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
BEGIN ;
2+
3+
CREATE VIEW layer2.designations AS
4+
SELECT
5+
-- можно еще добавить record_id - но я не представляю зачем это может понадобиться на этом уровне
6+
r.pgc
7+
, d.design
8+
, t.table_name -- я не уверен, что это нужно
9+
, t.bib
10+
, b.code
11+
, b.year
12+
, b.author
13+
, b.title
14+
FROM
15+
designation.data AS d
16+
LEFT JOIN layer0.records AS r ON (d.record_id = r.id)
17+
LEFT JOIN layer0.tables AS t ON (r.table_id = t.id)
18+
LEFT JOIN common.bib AS b ON (t.bib = b.id)
19+
;
20+
21+
COMMIT ;

0 commit comments

Comments
 (0)