Solved

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

Posted on 2008-10-15
7
940 Views
Last Modified: 2008-12-11
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
Comment
Question by:netadmin2004
  • 3
7 Comments
 

Author Comment

by:netadmin2004
Comment Utility
sorry.. lowercase letter :S
0
 

Author Comment

by:netadmin2004
Comment Utility
So is this impossible? Normally I get tons of responses on SQL queries.
0
 
LVL 29

Expert Comment

by:fibo
Comment Utility
Consider using a regexp

SELECT id, account, field3
          FROM table
          WHERE account REGEXP '[:lower:][:UPPER:]$'
     ;
0
 

Author Comment

by:netadmin2004
Comment Utility
cant use REGEXP in ms sql
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
what about this:
WHERE yourfield LIKE '%[a-z][A-Z]%'

Open in new window

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Loading csv or delimited data files to MySQL database is a very common task frequently questioned about and almost every time LOAD DATA INFILE comes to the rescue. Here we will try to understand some of the very common scenarios for loading data …
Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now