When to use UPPER and LOWER


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: When to use UPPER and LOWER

  1. #1
    Auseve Guest

    When to use UPPER and LOWER


    Q: You want to display the details of all employees whose last name is Smith.
    But you are not sure in which case last names are stored.

    A: SELECT last name, first name FROM emp WHERE LOWER(last name) = ('smith')

    Why is the answer not WHERE UPPER(last name) = ('smith')
    I thought UPPER was insensitive to case?

    This is a very basic question, so please help.

  2. #2
    Douglas J. Steele Guest

    Re: When to use UPPER and LOWER

    UPPER and LOWER change the string to be all upper case or all lower case
    respectively. In other words, UPPER(last name) could never equal 'smith',
    since it would have converted the string to upper case (SMITH)


    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele


    "Auseve" <wdesern@triad.rr.com> wrote in message
    news:3c99072f$1@10.1.10.29...
    >
    > Q: You want to display the details of all employees whose last name is

    Smith.
    > But you are not sure in which case last names are stored.
    >
    > A: SELECT last name, first name FROM emp WHERE LOWER(last name) =

    ('smith')
    >
    > Why is the answer not WHERE UPPER(last name) = ('smith')
    > I thought UPPER was insensitive to case?
    >
    > This is a very basic question, so please help.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center