INSERT() String Function in MySQL
Inserting text string into another string at a specified position and length using INSERT().
-- Replace 4 characters starting at position 3 with 'XYZ'
SELECT INSERT('Hello World', 3, 4, 'XYZ') AS modified_text;
-- Format customer phone numbers masking middle digits
SELECT INSERT('1234567890', 4, 4, '****') AS masked_phone;+---------------+--------------+ | modified_text | masked_phone | +---------------+--------------+ | HeXYZ World | 123****890 | +---------------+--------------+ 1 row in set (0.00 sec)