Here is a sample that might help get you going (untested due to no sample data):SELECT *FROM ( select ltrim(rtrim(firstname)) + ' ' + ltrim(rtrim(lastname)) as displayname, ltrim(rtrim(email)) AS Email, ltrim(rtrim(title)) AS Title, '0' AS Unknown, ROW_NUMBER() OVER ( PARTITION BY ltrim(rtrim(firstname)) + ' ' + ltrim(rtrim(lastname)) ORDER BY ?? ) AS RowNum from sysdba.contact where [lastName] is not null and displayname is not null and DataLength(Ltrim(Rtrim(displayname))) > 5 and [email] is not null and [title] is not null GROUP BY ltrim(rtrim(firstname)) + ' ' + ltrim(rtrim(lastname)), email, title ) AS AWHERE ROwNum = 1