我正在在线上学习教程,但我认为它有点过时或者他们正在使用其他程序,所以我只需要帮助将下面的SQL代码转换为PHP可以理解的版本即可。
SELECT qsu.UserFirstName + ' ' + qsu.UserLastName AS "FullName",
STUFF((SELECT '/' + r.RoleName FROM QuickbaseSystemUsers r on r.UserID = qsu.UserID FOR XML PATH('')), 1, 2, '') as "Roles",
NumberOfEditTotal << [however you calced this]
FROM vw_QuickbaseAudit v
INNER JOIN [staging].[QuickbaseSystemUsers] qsu ON v.[user] = qsu.UserId
WHERE Date_Modified >= @StartDate AND Date_Modified < DATEADD(dd, 1, @EndDate)
GROUP BY qsu.UserFirstName + ' ' + qsu.UserLastName,
STUFF((SELECT '/' + r.RoleName FROM QuickbaseSystemUsers r on r.UserID = qsu.UserID FOR XML PATH('')), 1, 2, '')
ORDER BY RoleName, NumberOfEditTotal DESC;