The data quality team needs to find duplicate customer emails. Use ROW_NUMBER() partitioned by email and ordered by created_at to assign a sequence number. Return only rows where the row number is greater than 1 (i.e., the duplicates). Show id, first_name, last_name, email, and the row number.
Schema
🔑idINT
first_nameTEXT
last_nameTEXT
emailTEXT
phoneTEXTNULL
date_of_birthTEXT
cityTEXT
stateTEXT
countryTEXT
created_atTIMESTAMP
postgresql
Run your query to see results
Press Ctrl + Enter to execute