SQL - Find string thats last letter is capitalized and the letter directly before it is lowercase

Hi all,

I need to find any word in my "account" field thats last letter is capitalized and the letter directly before it is lowercase

For example I need to fin "FarmerS" in "American FarmerS Association"

I've found how to find the Capital "S" however finding a lowercase number before hand is tricking me. Can someone help write a query for this?

Thanks, -RJ
netadmin2004Asked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
what about this:
WHERE yourfield LIKE '%[a-z][A-Z]%'

Open in new window

0
 
netadmin2004Author Commented:
sorry.. lowercase letter :S
0
 
netadmin2004Author Commented:
So is this impossible? Normally I get tons of responses on SQL queries.
0
 
Bernard S.CTOCommented:
Consider using a regexp

SELECT id, account, field3
          FROM table
          WHERE account REGEXP '[:lower:][:UPPER:]$'
     ;
0
 
netadmin2004Author Commented:
cant use REGEXP in ms sql
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.