sqlsugar的update()支持跨表条件更新吗? 返回

SqlSugar 老数据
2 3244

如实现这样的操作

update table1 
    set field1='aaaaaa'
from table2
    where table1.id=table2.id and table2.field2='xxxx'

热忱回答2

  • 目前不支持 

    0 回复
  • mansai mansai VIP0
    2017/11/22
    要两句实现,例如:
    var updateObjs = db.Queryable<Student, School>((st, sc) => st.SchoolId == sc.Id).Where(st => st.Name == "mansai").Select((st) => new Student { Name="mansai5", Id=st.Id }).ToList();
               db.Updateable(updateObjs).Where(true).ExecuteCommand();


    0 回复