options for returning distinct values across an inner join
问题 I have two tables. Table A contains UserID, UserName Table B contains ID, FK_UserID, ClientName I need to return a list of distinct A.UserName where A.Username exists in table B and has at least one ClientName attached to them, but in my query, only look at distinct B.ClientName. My thoughts were: Select Distinct A.UserName from A as A Inner Join B as B on A.UserID = B.FK_UserID But that only distincts on table A My next thought was: Select Distinct Username from A where UserID In ( Select FK