;With cte(dataa) as ( select 'Some Apples are Green' unio...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

;With cte(dataa)
as
(
select 'Some Apples are Green' union all
select 'Many Bananas are Yellow' union all
select 'Carrots are Orange'
)
select * into #temp from cte

create table #colors
(colorname varchar(100)
)

insert into #colors
values('green'),
      ('yellow'),
	  ('orange')
	  
	 

select dataa,b.colorname from #temp t
cross apply
(select  replace(t.dataa,colorname,'') as rplc,colorname
from #colors)b
where dataa<>rplc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results