• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 987
  • Last Modified:

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
0
netadmin2004
Asked:
netadmin2004
  • 3
1 Solution
 
netadmin2004Author Commented:
sorry.. lowercase letter :S
0
 
netadmin2004Author Commented:
So is this impossible? Normally I get tons of responses on SQL queries.
0
 
fiboCommented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
what about this:
WHERE yourfield LIKE '%[a-z][A-Z]%'

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now