try something like this DECLARE @UserId INTSELECT @UserId = 1SELECT GroupId, GroupNameFROM GroupsWHERE GroupType = 'Public'UNIONSELECT G.GroupId, G.GroupNameFROM Groups GINNER JOIN User_Groups UG ON UG.GroupId = G.GroupIdWHERE G.GroupType = 'Private' AND UG.UserId = @UserId
"There is only one difference between a dream and an aim. A dream requires soundless sleep to see, whereas an aim requires sleepless efforts to achieve..!!"