Skip to content

为什么同一个子查询在ISELECT中可以解析,在IUPDATE中却解析失败 #1330

Answered by 2881099
zjj10330 asked this question in Q&A
Discussion options

You must be logged in to vote

更新,删除没有做多表支持,考虑到:危险操作的场景毕竟是少数

可以观察以下输出:

var sql = freeSql.Select<OrderTable>()
    .Where(x => x.Status == 0)
    .Where(x => freeSql.Select<PayTable>().As("y").Any(y => y.PayId == x.PayId && y.Status == -1))
    .ToUpdate()
    .Set(x => x.Status == -1)
    .ToSql();

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zjj10330
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants