Solved

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

Posted on 2008-10-15
7
951 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi (http://code.openark.org/blog/mysql/on-restoring-a-single-table-from-mysqldump) had suggested a “sed” way, I actually shell …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

920 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

18 Experts available now in Live!

Get 1:1 Help Now