I have this query:
SELECT distinct
substr(p1.name,-1) as index_
p2.value as value
FROM pks p
LEFT JOIN Parameter p1 on p1.ID=p.id AND p1.NAME like '%TFrom%'
LEFT JOIN Parameter p2 on p2.ID=p.id AND p2.NAME like '%TFrom%' + substr(p1.name,-1)
WHERE p.type='singer'
What I want to do is to add the index_
value to the end of the p2.NAME
string.
Sometimes the index_
is (null)
, but I don't belive that It's a problem, as when it's an empty string it just should pass without adding somthing to the p2_NAME
string
In SQL server it can be done by adding this after the Join:
+(SUBSTRING(p1.NAME,[length], len(p1.PA_NAME)) )
But in Oracle it won't add a string to string. I'm sure that I'm missing somthing really small.