문제

I want to create the following query using Subsonic 2.2:

SELECT coalesce(col1, col2) AS result
FROM someTable
도움이 되었습니까?

해결책

Something similar to this:

DAL.DB.Select(
    string.Format("COALESCE({0}, {2}) as result",
        DAL.SomeTable.Columns.col1,
        DAL.SomeTable.Columns.col2
    ))
.From<DAL.SomeTable>()
...
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top