hi all,
i have the following t-sql query
SELECT
FilteredContact.contactid,
FilteredContact.fullname,
FilteredContact.birthdate,
FilteredConnection.record2roleidname,
FilteredConnection.record1idname
FROM
FilteredContact left JOIN
FilteredConnection ON FilteredContact.contactid = FilteredConnection.record2id
WHERE
(FilteredConnection.statuscode = 1) AND
(FilteredConnection.record1id IN (@contactid,@partnerid)) AND
(FilteredConnection.record2id = FilteredContact.contactid) AND
(FilteredConnection.record2roleidname in ('son','daugther'))
ORDER BY FilteredContact.fullname DESCand if i get 2 rows because the result matches for record1id = @contactid and for record1id = @partnerid, then i only want to get 1 resultrow with as 'common child'
Do i have to use a condition in select, or group by, or union?
THX Greets Pit