Update interactive-12.sql to match recent merge foreign key changes
with recursive extended_tags(s_subtagclassid,s_supertagclassid) as (
- (select s_supertagclassid,s_supertagclassid from subclass
- UNION select s_subtagclassid,s_subtagclassid from subclass
- )
+ select tc_tagclassid, tc_tagclassid from tagclass
UNION
- select s.s_subtagclassid,t.s_supertagclassid from subclass s, extended_tags t
- where s.s_supertagclassid=t.s_subtagclassid
+ select tc.tc_tagclassid, t.s_supertagclassid from tagclass tc, extended_tags t
+ where tc.tc_subclassoftagclassid=t.s_subtagclassid
)
select p_personid, p_firstname, p_lastname, array_agg(distinct t_name), count(*) --Q12
from person, post p1, knows, post p2, post_tag,
- (select distinct t_tagid, t_name from tag, tag_tagclass where t_tagid=ttc_tagid and (ttc_tagclassid in (
+ (select distinct t_tagid, t_name from tag where (t_tagclassid in (
select distinct s_subtagclassid from extended_tags k, tagclass
where tc_tagclassid = k.s_supertagclassid and tc_name = '--2--')
)) selected_tags
