我想根据一列的条件连接两个列值。
我正在尝试这样
select
{
Orders=r.ordercode.length==0?r.order1:r.ordercode.length==3?r.order1+r.order2+r.order3
}
答案 0 :(得分:0)
Orders = r.ordercode.length == 0?r.order1:r.ordercode.length == 3?string.concat(r.order1,“,”,r.order2,“,”,r.order3 ): “”
答案 1 :(得分:0)
试试这个
select
{
Orders = (
(r.ordercode.length == 0 || r.ordercode.length == 3) ?
String.Format("{0}, {1}, {2}", r.order1, r.order2, r.order3) :
String.Empty
)
}