嗨我有SQL表,我存储的值如下:
列名:Registration_ID
180,1801,1803,18011,220
180,1801,
180,1801,1803
不,我想匹配确切的Registration_ID并根据Registration_ID获取记录。我尝试过包含但不匹配确切的值。
这是我的问题:
var Result=db.Entity_StudentRepository.Get(x =>
x.Registration_ID.Contains(Used_For_Id.ToString())).Select(x => x.Registration_ID).ToArray();
答案 0 :(得分:1)
请您尝试以下查询并告知其是否有效 -
db.Entity_StudentRepository.AsEnumerable().Where(t=> Registration_ID.Split(',').Select(int.Parse).Contains(Used_For_Id));