Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: between '' and 'ZZZ'
Leo Baltus wrote:
>
> In article <8bvm86$i25$1_at_ctb-nnrp1.saix.net>,
> "Billy Verreynne" <vslabs_at_onwe.co.za> wrote:
> > Leo Baltus wrote in message <8bvje3$mn9$1_at_nnrp1.deja.com>...
> > >This is probably a newbe question, but anyway:
> > >
> > >Can somebody please explain the following :
> > >
> > >select * from table where col1 between '' and 'ZZZ'
> > >
> > >it gives no result, but when I try:
> > >
> > >select * from table where col1 between ' ' and 'ZZZ'
> >
> > I think it is because the first SQL means this:
> >
> > select * from table where col1 between NIL and 'ZZZ'
> >
> > NIL (or null) is not in any range - it a null, nothing, void.
> >
> > regards,
> > Billy
> >
> >
>
> That would mean oracle can not handle empty strings?
> As far as I know '' is an empty string wich is different from
> NULL wich is undefined, unknown etc.etc.
> --
> --
> Leo Baltus leob_at_isdc.nl
> ISDC, Hilversum , The Netherlands
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
True and false.
In some versions of Oracle they are treated as the same, others they are not.
Use
between chr(0) and 'ZZZ'
if you want this kind of query.
HTH
-- =========================================== Connor McDonald http://www.oracledba.co.uk We are born naked, wet and hungry...then things get worseReceived on Thu Mar 30 2000 - 00:00:00 CST