Select only values that do not start with a uppercase character

Posted on 2012-09-16
Last Modified: 2012-09-16
Hi Expert,

I'd like to extract all values from a field that do not start with a uppercase character.

But extracting all values without uppercase characters would work as well.

Kind regards,
Question by:Steynsk
    LVL 11

    Expert Comment

    by:Swapnil Nirmal
    Use Binary:

    SELECT *
    FROM Table1
    WHERE BINARY UPPER(Left('Field1',1) = Left('Field1',1)

    Just for reference:
    LVL 1

    Author Comment

    Hi n_swapnil,

    Thanks for the quick responce. but the statement selects all records:

    SELECT * FROM people WHERE BINARY UPPER(Left('givenname',1) = Left('givenname',1))

    And instead of that it should only show the people with a givenname without uppercase characters.

    LVL 11

    Expert Comment

    by:Swapnil Nirmal
    Try this:

    SELECT * FROM people WHERE BINARY LOWER(Left('givenname',1) = Left('givenname',1))
    LVL 82

    Accepted Solution

    NOTE: you need to enclose the field/column name in backticks (`) NOT in apostrophes(').

    SELECT * FROM people where ((BINARY `givenname`) REGEXP '^[a-z]')
    SELECT * FROM people WHERE BINARY LOWER( Left(`givenname`,1) ) = Left(`givenname`,1)
    LVL 1

    Author Closing Comment

    SELECT * FROM people where ((BINARY `givenname`) REGEXP '^[a-z]')

    did the job.


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
    Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    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…

    731 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

    15 Experts available now in Live!

    Get 1:1 Help Now