c# - group by first letter of the string -
i have person table, huge number of records, , want group duplicate persons in it, 1 of requirements persons duplicates, if have same family name, , first letter of first names equal, want group first name, , first letter of family name, there way group in sql this? need in c#, code processing done, number of persons huge, should fast algorithm.
select member.member_firstname, count(member.member_lastname) dbo.member group member.member_firstname, substring(member.member_lastname, 1,1) having count(member.member_lastname) > 1
this query give (members in case) first name same , last name's first letter same more 1 member. in other words duplicates you've defined it.
Comments
Post a Comment