Click here to Skip to main content
15,891,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to show the name start with a ends with e using regular expression in sql query

What I have tried:

i tried SELECT `supplier_name` FROM supplier_details WHERE Name REGEXP \ba(....)\le\b\ but its wrong.can anyone help
Posted
Updated 5-Sep-17 21:39pm

As an alternative, you could use the LIKE operator[^].
 
Share this answer
 
Read about the regular expression syntax for your SQL server (e.g. MySQL :: MySQL 5.5 Reference Manual :: 12.5.2 Regular Expressions[^] for MySQL).

In general, something like ^a.*e$ should work (^ = begin of string, . = any character, * = zero or more times, $ = end of string).

In your case you might also use a LIKE expression:
SQL
WHERE Name LIKE 'a%e'
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900