posted on April 23, 2016 05:09
SELECT UserID, Username, FirstName, LastName, IsSuperUser, AffiliateId, Email, DisplayName, UpdatePassword, LastIPAddress, IsDeleted, CreatedByUserID, CreatedOnDate, LastModifiedByUserID,
LastModifiedOnDate, PasswordResetToken, PasswordResetExpiration, LowerEmail
FROM Users
ORDER BY RIGHT(Email, LEN(Email) - CHARINDEX(
'@', Email))