如何使用SubSonic3编写此sql查询?

如何使用SubSonic3编写此sql查询?,subsonic,subsonic3,Subsonic,Subsonic3,因此,它基本上是用当前值减去1来更新列。这应该有帮助: UPDATE Scenarios.Blocks SET OrderId = OrderId - 1 db.Update.Set(x=>x.OrderId==x.OrderId-1.Execute(); 如果要为更新查询使用where子句: db.Update<Blocks>.Set(x => x.OrderId == x.OrderId - 1).Execute();

因此,它基本上是用当前值减去1来更新列。

这应该有帮助:

UPDATE  Scenarios.Blocks 
SET     OrderId = OrderId - 1 
db.Update.Set(x=>x.OrderId==x.OrderId-1.Execute();
如果要为更新查询使用where子句:

db.Update<Blocks>.Set(x => x.OrderId == x.OrderId - 1).Execute();