Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT *
- FROM (SELECT * FROM Customer c WHERE c.Created >= DATEADD(MONTH, -6, GETUTCDATE())) c1
- JOIN (SELECT * FROM Customer) c2 ON c1.CustomerID <> c2.CustomerID
- WHERE (c1.DOB IS NULL OR c2.DOB IS NULL OR c1.DOB = c2.DOB)
- AND DIFFERENCE(c1.FirstName, c2.FirstName) = 4
- AND DIFFERENCE(c1.LastName, c2.LastName) = 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement