title: What is the linq equivalent for the TSQL with join and group by?
body: <p>I'm trying to create a linq query from the following sql.</p>
  
  <p>Couldn't find an example that had a join in it with multiple tables and a group by that had different fields from different tables.</p>
  
  <pre><code>select t2.field1, t1.field1, count(t2.field1) from Table1 t1
  join Table2 t2 on t1.pkfield = t2.pkfield
  group by t2.field1, t1.field1
  having count(*) &gt; 1
  order by t2.pkfield1
  </code></pre>
  
  <p>Tried the following:</p>
  
  <pre><code>var test = 
    from t1 in db.Table1
    join t2 in db.Table2 on t1.pkfield equals t2.pkfield
    group x by (t1.field1, t2.field1)
    select t1.field1, t2.field2 
  </code></pre>