Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: How to select column with one or more spaces

Re: How to select column with one or more spaces

From: Daniel A. Morgan <Daniel.Morgan_at_attws.com>
Date: Tue, 03 Jul 2001 14:44:51 -0700
Message-ID: <3B423CD3.B462DFB6@attws.com>

Andy Ho wrote:

> If you used like ' %', it'll return rows starting with one space followed by
> any text (or none), including ' ABC', which is NOT what I want.
> >===== Original Message From "Daniel A. Morgan" <Daniel.Morgan_at_attws.com>



> >Andy Ho wrote:
> >
> >> Hi,
> >>
> >> I wonder if there is a way in a query to select column with one or more
> >> spaces. For the query below, it can only get rows with one space.
> >>
> >> select col_name from tab_name
> >> where col_name = ' ';
> >>
> >> Thanks, Andy
> >>
> >> ------------------------------------------------------------
> >> Get your FREE web-based e-mail and newsgroup access at:
> >> http://MailAndNews.com
> >>
> >> Create a new mailbox, or access your existing IMAP4 or
> >> POP3 mailbox from anywhere with just a web browser.
> >> ------------------------------------------------------------
> >
> >Have you considered the LIKE operator?
> >
> >Daniel A. Morgan
>

> ------------------------------------------------------------
> Get your FREE web-based e-mail and newsgroup access at:
> http://MailAndNews.com
>

> Create a new mailbox, or access your existing IMAP4 or
> POP3 mailbox from anywhere with just a web browser.
> ------------------------------------------------------------

And if you wrote it this way:

SELECT *
FROM mytable
WHERE columnvalue LIKE '%
AND columnvalue NOT LIKE ' %'

What would be the problem?

Daniel A. Morgan Received on Tue Jul 03 2001 - 16:44:51 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US