Viewing 2 posts - 1 through 2 (of 2 total)
You could use a recursive cte to split the strings:
WITH rep AS
(
SELECT
cod
,';' delim
,name
from t
UNION ALL
LEFT(cod, CHARINDEX(delim, cod, 1) - 1)
,delim
,LEFT(name, CHARINDEX(delim, name, 1) - 1)
FROM rep
WHERE (CHARINDEX(delim, cod,...
March 7, 2013 at 1:54 am
#1594332
Sounds like you need a couple of left joins and a case - this should do...
s.sno
,CASEWHEN e.sno IS NOT NULL THEN
'Y'
WHEN n.sno IS NOT NULL THEN
'N'
WHEN e.sno IS NULL...
March 5, 2013 at 2:01 am
#1593323