tags:

views:

56

answers:

1
SELECT * 
FROM table1 JOIN table2 
ON table1.center BETWEEN table2.left AND table2.right

I'm new to LINQ, and I've seen that 'join' require an 'equals' keyword (instead of BETWEEN in my SQL). Perhaps I could override 'Equals' operator and create a new object of a LINQ query?

+4  A: 

For things other than equals you put your join criteria in the where clause. It is similar to old style SQL where you start with a cartesian join and then filter on the where clause.

from t1 in table1
from t2 in table2
where t1.centre >= t2.left && t1.centre <= t2.right
select new { ta.centre, t1.left}; //add more fields as required.
Ben Robinson