Hi so I have email addresses saved for example in below format:
[email protected]
[email protected]
[email protected]
As can be seen everything is same in these email except for the number before @ sign. I want to select the last biggest email address with that number in this case [email protected] since 3 is biggest number in these emails.
I am not much aware about regex but I tried this:
SELECT id, email FROM tableName WHERE email regexp 'NEWUSER(\d+)@domain.com'
ORDER BY email DESC LIMIT 1
But it didn't work obviously regex isn't correct :( Can anyone help on how to select row with biggest number email out of these please ?
NEWUSER(\d+)@domain.comwhere\dis a number you know but it doesn't return any rows obviously regex isn't correct