We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
SELECT DISTINCT C.CustomerID, C.FirstName, C.LastName, C.Email, C.Password, C.Address, C.City, C.State, C.Country, C.Post, C.Phone, C.BestTimes, C.CreateDate, C.LastLogin, C.ContactPref, C.EstGiven, C.JobFini, C.Deposit, C.ActiveCust, C.CustNotes, B1.ImageID AS LatestImageID, B2.Comment AS LatestComment, B2.Poster, B2.PostDate AS Postdate FROM Customers AS C LEFT OUTER JOIN Employees AS E ON C.empID = E.empID LEFT OUTER JOIN (SELECT CustomerID, MAX(PostDate) AS MaxDate FROM blog WHERE (ImageID <> '') GROUP BY CustomerID) AS M1 ON M1.CustomerID = C.CustomerID LEFT OUTER JOIN blog AS B1 ON B1.CustomerID = M1.CustomerID AND B1.PostDate = M1.MaxDate LEFT OUTER JOIN (SELECT CustomerID, MAX(PostDate) AS MaxDate FROM blog AS blog_1 WHERE (Comment <> '') GROUP BY CustomerID) AS M2 ON M2.CustomerID = C.CustomerID LEFT OUTER JOIN blog AS B2 ON B2.CustomerID = M2.CustomerID AND B2.PostDate = M2.MaxDate WHERE (E.Username = @username) AND (C.ActiveCust = 1) ORDER BY C.LastLogin DESC
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.