Solved

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

Posted on 2008-10-15
7
960 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
ID: 22721663
sorry.. lowercase letter :S
0
 

Author Comment

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

Expert Comment

by:fibo
ID: 22728353
Consider using a regexp

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

Author Comment

by:netadmin2004
ID: 22733336
cant use REGEXP in ms sql
0
 
LVL 142

Accepted Solution

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

Open in new window

0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

770 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