I'm a beginner in DB2 and for my company I have to write a sql statement. The statement is already working in Oracle but it doens't work with DB2. Does somebody know how to make this query work?
(sleutel of key is for example "VAR_TST" and xdata.sleutel = also "VAR_TST")
select *
from xdata
where sleutel = '",sleutel of key,"'
and exists(
select * from xdata w
where w.sleutel > 0
and w.extra like '%-' || xdata.sleutel || '-%'
)
In Oracle is:
sleutel = VARCHAR2
extra = VARCHAR2