Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: case insensitive query
On Tue, 03 Nov 1998 16:26:22 -0800, Jason Jay Weiland
<archduke_at_uclink4.berkeley.edu> wrote:
>Min,
>
> You could try using the UPPER or LOWER charcter
>functions:
>
>SELECT first_name, last_name
> FROM people
> WHERE LOWER(last_name) = LOWER('Wang')
> AND UPPER(first_name) = UPPER('Min');
>
Keep in mind that with the above query, when you apply a function to the database column (and not just the criteria), you will not be using an index. Oracle has to read every column value, apply the function, and then perform the comparison...resulting in a full-table scan of the people table.
A great way to do this would be to store your data value for first_name and last_name in some common case (either upper or lower) and then apply the appropriate function to only the criteria in your query.
>Jay!!!
>
Thanks!
Joel
Joel R. Kallman Oracle Government, Education, & Health
Columbus, OH http://govt.us.oracle.com jkallman@us.oracle.com http://www.oracle.com
![]() |
![]() |