什么是正确的查询?
我想将“年”作为参数:
select distinct
p.id "pub_id"
from
publication "p", organisation_association "oa", organisation "o", localized_string_text "lst_org"
where
p.id = oa.publication_id
and oa.organisation_id = o.id
and o.name_id = lst_org.localized_string_id
and p.submission_year = ?
and exists (select 1
from
publication "p2", organisation_association "oa2", organisation "o2"
where
p2.id = p.id
and p2.id = oa2.publication_id
and oa2.organisation_id = o2.id
and o2.period_end_date < date ? + '-01-01')
但是,最后一行的连接会产生语法错误。