I need to perform the following query using HSQL (with ORACLE works fine):
select t.name as sh_name,
b.name as sh_bName
from PERSON t
left outer join TRANS tr on t.id=tr.tid
left outer join AGREEM agr on tr.tripNumber=SUBSTR(agr.coll_external,1,4)
left outer join PERSON b on (b.TYP='BROKER' and agr.broker_id = b.id)
where t.TYP='TRADER'
I receive the following error: not allowed in OUTER JOIN condition in statement
. The problem comes from the usage of SUBSTR
, without it I don't receive any error. In Oracle the above statement works just fine.
Any idea how I can use SUBSTR
in a join clause with HSQL?