1.原生查询示例: $Model = new Model(); $sql = 'select a.id,a.title,b.content from think_test1 as a, think_test2 as b where a.id=b.id '.$map.' order by a.id '.$sort.' limit '.$p->firstRow.','.$p->listRows; $voList = $Model->query($sql); 2.join()方法示例: $us…
单一条件查询: var table2Object = (from t1 in db.table1 join t2 in db.table2 on t1.id equals t2.id select t2).FirstOrDefault(); 复合条件 查询: 多个主键 联合查询 var table2Object = (from t1 in db.table1 join t2 in db.table2 on new { t1.id, t1.another_id } equals new { t2.…