0

我想使用 Subsonic 2.2 创建以下查询:

SELECT coalesce(col1, col2) AS result
FROM someTable
4

1 回答 1

1

与此类似的东西:

DAL.DB.Select(
    string.Format("COALESCE({0}, {2}) as result",
        DAL.SomeTable.Columns.col1,
        DAL.SomeTable.Columns.col2
    ))
.From<DAL.SomeTable>()
...
于 2012-07-17T08:52:48.817 回答