May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.
DECLARE @CounsumerProfileID INT; SET @CounsumerProfileID = 35557; SELECT ewC.ConsumerProfileID MyID, ewC.UserID MyUserID, ewC.FirstName , ewC.LastName , c2.FollowerConsumerProfileID FollowingMeID, c2.FirstName + ' ' + c2.LastName FollowingMeName , c2.AvatarImage FollowingMeAvatar , --If I am following the person that is following me CASE WHEN c3.ConsumerProfileID IS NULL THEN 0 ELSE 1 END I_AM_Following FROM ewConsumerProfiles ewC --Get people who are following me LEFT JOIN ( SELECT cp.ConsumerProfileID AS FollowerConsumerProfileID , cp.FirstName , cp.LastName , cp.AvatarImage , cf.ConsumerProfileID FROM ewConsumerFollowing cf INNER JOIN ewConsumerProfiles cp ON cp.ConsumerProfileID = cf.FollowingConsumerProfileID ) c2 ON ewC.ConsumerProfileID = c2.ConsumerProfileID --Get the people I am following LEFT JOIN ( SELECT ConsumerProfileID , FollowingConsumerProfileID FROM ewConsumerFollowing WHERE FollowingConsumerProfileID = @CounsumerProfileID ) c3 ON c2.FollowerConsumerProfileID = c3.ConsumerProfileID WHERE ewC.ConsumerProfileID = @CounsumerProfileID;
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Format Date fields||11||56|
|section a string||5||52|
|SQL Server sp_executesql / Change Tracking Version() results into variable||4||28|
Join the community of 500,000 technology professionals and ask your questions.