Mask a card number

Mask a card number

Card numbers must be anonymized before tickets are exported. Find tickets containing a card number made of four groups of four digits separated by spaces and return ticket_id and masked_body, replacing the first 12 digits with * while preserving the spaces and final four digits. Sort the rows by ticket_id ascending.

Row order matters

PostgreSQLv16

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid