I have table like this excpet for 2 values,have to display samedata present in table for remaing 2 columns data will be displayed based on specific data.Data will be displayed as is if any type of data present in table except for Newzealan Gucklan,Newzealan Gucklan1.codes presnet in this columns may change and ists not static code values( like 10,20,30)
why do you expect Guklan to change to Gucnewz? do you want all codes with 'lan' in them to have 'lan' replaced with 'newz'? If not, what is the criteria?
I have to pick After Space first3charcters and starting 4letters for Newzealan Gucklan and
first3charcters and last numeric value and starting 4letters for Newzealan Gucklan1.
every time i expect trump scenario data exactly for remaing it should be as usual.So here my case every time i expect Newzealan Gucklan,Newzealan Gucklan1 are special data and rest we will not consider for that rule
"every time i expect trump scenario data exactly for remaing it should be as usual."
Whew! a bit tough to parse that! BTW what's your first language?
I think you may want something like this:
select case when Countrynamecode like 'Newzealan Gucklan%'
then substring(Countrynamecode, 11, 3)
+ substring(Countrynamecode, 1, 4)
+ substring(Countrynamecode, 18, 255)
else Countrynamecode
end as Countrynamecode
from table1