2014-01-16 70 views
-2

如何使用SQL編寫不等於操作中的LINQ如何寫查詢在LINQ對於這個下面的情形

select A.ID,B.TestName from sampleTable A join TestTable b on A.ID<>B.ID. 
+1

你怎麼能找不到這個問題? http://stackoverflow.com/questions/18274141/how-to-wirte-not-equal-operator-in-linq-to-sql –

回答

0

嘗試!= operator這樣的:

select A.ID,B.TestName from sampleTable A join TestTable b on A.ID!=B.ID. 
0

嘗試!=-Operator(不等式運算符)

... join TestTable B on A.ID != B.ID 
0
var result = from a in context.sampleTable 
      join b in context.TestTable on a.ID != b.ID 
      select new { a.ID, b.TestName }