Sunday, February 2, 2014

how to find All names of the Father with the Son and show it in the order ?


Hi srajmuneer,


The best way is to use SSIS fuzzy technique. However we can use SOUNDEX function for this. Refer below.



;with cte as (
select 'jon acer sham' fullname
union all
select 'rat kasm alo' fullname
union all
select 'haik dosk kam' fullname
union all
select 'sam jon acer' fullname
union all
select 'dosk kam rad' fullname
union all
select 'assed rat kasm' fullname)
select *,soundex(fullname) id from cte
order by right(soundex(fullname),3)

http://ift.tt/1bgFIZC


http://ift.tt/1bgFGRD?




Regards, RSingh





Wont always give you intended output especially when there are similar namescheck with below sample data



with cte as (
select 'jon acer sham' fullname
union all
select 'rat kasm alo' fullname
union all
select 'haik dosk kam' fullname
union all
select 'sam jon acer' fullname
union all
select 'dosk kam rad' fullname
union all
select 'assed rat kasm' fullname
union all
select 'ryan kam rad' fullname
union all
select 'assed myor kasm' fullname
union all
select 'kam rad ryan' fullname
union all
select 'kasm rat assed' fullname
union all
select 'kasm myor assed' fullname)
select *,soundex(fullname) id from cte
order by right(soundex(fullname),3)





Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


No comments:

Post a Comment