I'm trying to select some records from a data extension where an email address appears more than once with a different date, using this query:
SELECT emailAddress, MIN(scheduleDate) AS scheduleDate FROM CC_B2B_All_Info GROUP BY emailAddress
This gives me the correct amount - 127 records, out of 403. Howevr, there are several other columns - position, slot and client, which I need to pull through as well. When I add these to the SELECT and GROUP BY clauses, the query then pulls through all 403 records instead of the 127. What am I doing wrong?
SELECT emailAddress, MIN(scheduleDate) AS scheduleDate, position, slot, client FROM CC_B2B_All_Info GROUP BY emailAddress, position, slot, client