SELECT C.[SysNo] （只取主键一个字段）,Row_Number() OVER (Order BY #SortColumnName#) AS RowNumber FROM [dbo].[Customer] AS C WITH(NOLOCK) LEFT JOIN [dbo].[Customer_Extend] AS E WITH(NOLOCK) ON C.SysNo = E.CustomerSysNo