Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am looking for a simple way to search strings for pattern matching with data like these.
6041AGSMVW1B
6041AGSMVW2B
6041AGSVW
6041AGSVW1B
6041ASMH
6041ABSM
6041ABSM1B
I want to search for 6041A%B%[0-9]% but exclude B from the search if it is only after the second numeric string. So in the examples above 6041ABSM would be returned but not 6041AGSMVW1B, 6041AGSMVW2B, 6041AGSVW1B or 6041ABSM1B.

Any help would be appreciated.

What I have tried:

This is the sort of query I have tried
SELECT * FROM magcatalog m WHERE ArgicCode LIKE '6041A%B%[0-9]%';
Posted

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