Re: Question on Case-insensitive queries

From: David Crowson <zdxc0d_at_amoco.com>
Date: Mon, 12 Jul 1993 11:15:50 CDT
Message-ID: <1993Jul12.111550.22878_at_amoco.com>


In article HIA_at_isst.fhg.de, umatz_at_isst.fhg.de (Udo Matzinger) writes:
>Sudhakar Bhagavatula (sab3_at_Ra.MsState.Edu) wrote:
>: Hi,
>: Could someone please tell the method to perform Case-insensitive
>: queries. Please send me an e-mail to:
>: sudhakar_at_cs.msstate.edu
>:
>: Thanks in advance.
>:
>: --Sudhakar.
 

>: --
>: << Sudhakar >>
>
>Hi,
>i want to know the answer to this question, too.
>Can you please post a summary or mail me direct.

to do this all you need is UPPER(field_name) LIKE '%ADBGGFF%'

assuming field_name is a char field and ADBGGFF is the search string or you could use = or another function (<,>,soundex etc) instead of LIKE. e.g.
select *
from dummy
where UPPER(first_name) LIKE 'DAVE%';

Of course if you put a % before the search string ie '%DAVE%' then you will not be using thew index (if there is one) but will be doing a full table scan.

PS you could use LOWER() as well.

---

*******************************************************************************
*  David Crowson        *  "It's a small world but a damn big planet!"        *
*  DBA                  *  "You can't have my shiny thing.If you try and      *
*  Amoco Exploration    *   take it I may have to eat you.It's my all-time    *
*  (UK) Ltd             *   bestest luckiest find I ever found in the whole of*
*  Hanger Lane          *   today!. ...And it does two amazing things.."      *
*  Ealing               *   "If God is Infinite and the Universe is Finite -  *
*  London               *      Would you like some Toast?"                    *
*                       *  The views expressed here are of my own volition    *
*                       *  and do not necessarily represent that of my        *
*                       *  employers , nor are these views worth the paper    *
*  dcrowson_at_amoco.com   *  upon which they are written, nor do I make much    *
*  0850 346760          *  sense to anyone including myself.                  *
*******************************************************************************
Received on Mon Jul 12 1993 - 18:15:50 CEST

Original text of this message