C# ling to sql 左表连接

  var begin_daily = from a in _postgreDbContext.tab1
                                      join b in _postgreDbContext.tab2 on a.id equals b.merchant_id into a_left
                                      from  left_a in a_left.DefaultIfEmpty()
                                      where left_a.date.ToString("yyyy-MM-dd") == begin_date
                                      select new {
                                        left_a.id,
                                        left_a.balance,
                                        left_a.service_balance,
                                        left_a.paid_money
                                      };

 

posted @ 2019-10-24 15:15  低调码农哥!  阅读(548)  评论(0编辑  收藏  举报