I'm querying a database to select strings which end in a certain substring, such as yahoo.com
.
To select equal strings, I would call select * from users where email='[email protected]'
.
How do I select users whose emails end in yahoo.com
?
If you use a like search and DO NOT put a percent on the end, it is effectively an "ends with".
Select * from users where email like '%yahoo.com'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With