Skip to content

Instantly share code, notes, and snippets.

@cemerson
Created September 30, 2025 10:40
Show Gist options
  • Save cemerson/02d17fa69bdf4a64c71376ed09f835ae to your computer and use it in GitHub Desktop.
Save cemerson/02d17fa69bdf4a64c71376ed09f835ae to your computer and use it in GitHub Desktop.
sql-email-mask-query-p2-privacy.sql
SELECT
LEFT(email_column, 1) + '...' + '@' +
RIGHT(email_column, LEN(email_column) - CHARINDEX('@', email_column)) AS masked_email
FROM your_table;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment