Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: problem with like
I guess the deeper problem is the datatype CHAR!
So a name like 'mat' will be stored as 'mat[17 spaces]'
For this very reason the datatype 'VARCHAR2' exists.
Try
select * from table where rtrim(column) like '%t'
... and if you want case insensitive also then: rtrim(upper(column)) like '%t'
Anurag
"Cameron Abbott" <cvabbott_at_altavista.com> wrote in message
news:9oct7d$1s2$1_at_bcarh8ab.ca.nortel.com...
> Where in the name is 'ot'? %ot will only return names that end in 'ot'.
> It is also case sensitive. Try
> select * from my_table where upper(my_name) like '%OT%'
>
> "thierry" <thierry.constant2_at_wanadoo.fr> wrote in message
> news:3BA9F3E3.56E85B92_at_wanadoo.fr...
> > Hi,
> >
> > In my_table, I have a column my_name type char(20)
> > when I do:
> >
> > select * from my_table where my_name like '%t'
> >
> > nothing is returned...
> > though there are records like %t
> >
> > What's happen ???
> > Thanks
> >
> >
> >
>
>
Received on Thu Sep 20 2001 - 09:50:03 CDT