我很好奇为什么我的 linq group by query 返回 417 结果而我的 SQL 解释返回 419?我正在从我的列表中寻找重复的电子邮件。我检查了结果集,并且 linq 集中缺少的两个电子邮件地址都有重音。linq 不识别口音吗?有解决方法吗?电子邮件字段类型是 nvarchar(100)。
如果您有任何问题,请告诉我,提前致谢!
var listOfContacts = (from contacts in something
where contacts.Team.Id.Equals(TeamGuid) && !contacts.Email.Equals(null)
select new {contacts.Id, EmailAddress = contacts.Email.ToLower()}).ToList();
//Full Contact List; exact amount matches
var dupeEmailsList = listOfContacts
.GroupBy(x => x.EmailAddress)
.Where(g => g.Count() > 1)
.Select(y => y.Key)
.ToList();
//Returns 417
SELECT Email, COUNT(*)
FROM something
WHERE Team = 'Actual Team Guid Inserted Here'
GROUP BY Email
HAVING (COUNT(LOWER(Email)) > 1 AND Email IS NOT NULL)
ORDER BY Email
//Returns 419
叮当猫咪
慕的地6264312
相关分类