Witam,
Mam takiego CASE'a
case
when charindex('{{', substring(zamdostpoz.uwagi,1,8000))<>0
then reverse(substring(reverse(substring(zamdostpoz.uwagi, 1, 8000)), 1 ,charindex('}}',reverse(substring(zamdostpoz.uwagi, 1, 8000)))-1))
else substring(zamdostpoz.uwagi, 1, 8000)
end as uwagi_poz
Działa to tak, że usuwa mi tekst umieszczony w {{ }} ale tylko jeżeli jest on na początku np.
{{test1}} test2 to wypisze test2 i jest ok. Jeżeli sytuacja jest odwrotna tzn. mam test2 {{ test1}} to już nie wyświetla nic a chciałby aby wyświetlił również test2.
Jak sobie z tym poradzić?