Re: SQL Query

From: Pat McMichael <pmcmicha>
Date: 1996/05/23
Message-ID: <4o21r4$3sh_at_cisu2.jsc.nasa.gov>#1/1


Try

    select * from test where name like 'hel%'

       and substr(name,4,1) in ('p','l','y')

That should work.

Mark Edwards <100325.223_at_compuserve.com> wrote:
>Red devil wrote:
>>
>> Shuzi Chen <chen_at_openmarket.com> wrote:
>>
>> >How to write the SQL like the following?
 

>> > select * from test where name like 'hel[ply]'
>> > it will return the records which name is help, hell or hely.
>> >Sybase can do exactly like the above. I do not think the Oracle supports
>> >the [].
 

>> >Thanks in advance.
>> >--
>>
>>----------------------------------------------------------------------
>> >Shuzi Chen
>> >chen_at_openmarket.com
>>
>> Like that:
>> where name like 'hel_'
>> but it will of course return other name : hela, helu, ....
>
>Suzi,
>
>I guess that you will have to go around the long
>way:
>
>where name like 'help' or name like 'hell' or name
>like 'hely'
>
>in the abscence of other workarounds...
>
>Mark Edwards
Received on Thu May 23 1996 - 00:00:00 CEST

Original text of this message