clone、linq左连接

SELECT  STUFF(   (SELECT ','+Symbol from SM_Product for XML PATH('')), 1, 1, ''      ) 结果:SH600004,SH600005,SH600006

var sqlParaArr = paraList.Select(x => ((ICloneable)x).Clone()).ToArray();   

var data=     from a in db.Trade_Orders
                       join b in db.Sys_Products
                       on
                       new { Symbol = a.OpeningPositionSymbol, GroupId = a.GroupId }
                       equals new { Symbol = b.Symbol, GroupId = b.GroupId }
                       into t1  from temp1 in t1.DefaultIfEmpty()
                       where  a.AccountNo == accountNo
                       orderby a.OpeningPositionTime descending
                       select  new
                       {
                           CName = temp1 == null ? "" : temp1.CName,
                           PriceLength = temp1 == null ? 0 : temp1.PriceLength,
                           AccountNo = a.AccountNo,
                           CreateTime = a.CreateTime,

                       }

猜你喜欢

转载自blog.csdn.net/xml714467338/article/details/79260345