SELECT TOP 500 Logis_fahuoHeader.ID, ..... Logis_fahuoHeader.DriverTel, Logis_fahuoHeader.SystemNOs, Logis_fahuoHeader.HasPeisongshang, Logis_fahuoHeader.HasChengyunshang, Logis_fahuoHeader.shouhuoren, CASE WHEN fanhuitupian IS NULL THEN '否' ELSE '是' END AS shifoushangchuanqiandan, ( SELECT MyName FROM Basic_chengyunshang WHERE ID = CooperateIDchengyunshang ) AS chengyunshang, ( SELECT MyName FROM Basic_chengyunshang WHERE ID = CooperateIDpeisongshang ) AS peisongshang FROM Logis_fahuoHeader WHERE 1 = 1 AND IsTemp = 0
SELECT Logis_shouhuoHeader.*, ( SELECT TOP 1 myname FROM dbo.Basic_chengyunshang WHERE ID = CooperateIDchengyunshang ) AS chengyunshang, ( SELECT TOP 1 myname FROM dbo.Basic_chengyunshang WHERE ID = CooperateIDpeisongshang ) AS peisongshang FROM dbo.Logis_shouhuoHeader, dbo.Logis_fahuoHeader, dbo.Logis_fahuoDetail WHERE Logis_shouhuoHeader.ID = Logis_fahuoDetail.shouhuoHeaderID AND Logis_fahuoDetail.HeaderID = Logis_fahuoHeader.ID AND Logis_shouhuoHeader.DateTihuo >= '2017-05-01 00:00:00' AND Logis_shouhuoHeader.DateTihuo <= '2017-05-01 23:59:59' AND CooperateIDpeisongshang IN ( SELECT ID FROM dbo.Basic_chengyunshang WHERE MyName = 'xiaowang' );
如上两段sql 如何用linq或者lambda写
有人吗😳