Moved project directories and files to an empty local repo
This commit is contained in:
22
PostgreSQL_Database/eht_view.pgsql
Normal file
22
PostgreSQL_Database/eht_view.pgsql
Normal file
@@ -0,0 +1,22 @@
|
||||
DROP VIEW eht_view;
|
||||
|
||||
CREATE OR REPLACE VIEW eht_view AS
|
||||
SELECT
|
||||
e.*,
|
||||
h.host,
|
||||
t.tag,
|
||||
(select string_agg(tag, ', ')
|
||||
from tags t2, episodes_tags_xref et2
|
||||
where et2.tags_id = t2.id
|
||||
group by et2.episodes_id
|
||||
having et2.episodes_id = e.id) as tags
|
||||
FROM episodes e, hosts h, episodes_hosts_xref eh, episodes_tags_xref et, tags t
|
||||
where e.id = eh.episodes_id
|
||||
and h.id = eh.hosts_id
|
||||
and e.id = et.episodes_id
|
||||
and et.tags_id = t.id
|
||||
group by e.id,h.host,t.tag
|
||||
order by e.id;
|
||||
|
||||
ALTER TABLE eht_view
|
||||
OWNER TO hpradmin;
|
Reference in New Issue
Block a user