Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Linq to SQL query and SQL query return diffrent results

$
0
0

I try the same SQL question on two diffrent ways and I get diffrent results.The first way is SQL view in Visual Studio

SELECT DISTINCT ruleValue
FROM rules
WHERE (ruleValue LIKE '%ORG%')

and the second one is

DataClassesDataContext db = new DataClassesDataContext();
var numRulesQueryORG = (from r in db.rulesTableNews
where r.ruleValue.Contains("ORG")
select r.ruleValue).Distinct();

In the first way I got 165 results and in the second 65 results 

Does any body know what is wrong?I like to select only distinct values from column ruleValues from records that contain ORG.


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>