agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
trouble with "like" clause
2+ messages / 2 participants
[nested] [flat]

* trouble with "like" clause
@ 1995-06-28 14:54 matthew@risetime.com <matthew@interaccess.com>
  1995-07-06 19:11 ` Re: trouble with "like" clause Paul M. Aoki <aoki@CS.Berkeley.EDU>
  0 siblings, 1 reply; 2+ messages in thread

From: matthew@risetime.com @ 1995-06-28 14:54 UTC (permalink / raw)
  To: legacy

I want to be able to do a substring case-insensitive search on a text field.

So far I have:
	SELECT * from Movies WHERE MovieName ~ "[Bb][Aa][Tt]*"

Which will make macthes with "Batman Forever".  If I instead enter in
"Forever" I should also make a matche, however, change the where clause to
"*[Ff][Oo][Rr][Ee][Vv][Ee][Rr]" failes to find a match.

What the correct syntax for that?

- mz

----
matthew zeier                     "Do what you can with what you have
  matthew@risetime.com             where you are."  -Teddy Roosevelt
......................................................................
Programmer / Online Junkie                        Ph. 708/483-8787
  "So no one told you like was gonna be this way..."

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: trouble with "like" clause
  1995-06-28 14:54 trouble with "like" clause matthew@risetime.com <matthew@interaccess.com>
@ 1995-07-06 19:11 ` Paul M. Aoki <aoki@CS.Berkeley.EDU>
  0 siblings, 0 replies; 2+ messages in thread

From: Paul M. Aoki @ 1995-07-06 19:11 UTC (permalink / raw)
  To: matthew@interaccess.com; +Cc: postgres-arch@postgres.Berkeley.EDU

"matthew@risetime.com" <matthew@interaccess.com> writes:
> I want to be able to do a substring case-insensitive search on a
> text field.
> 
> So far I have:
> 	SELECT * from Movies WHERE MovieName ~ "[Bb][Aa][Tt]*"
> 
> Which will make macthes with "Batman Forever".  If I instead enter in
> "Forever" I should also make a matche, however, change the where clause to
> "*[Ff][Oo][Rr][Ee][Vv][Ee][Rr]" failes to find a match.

it's a c regular expression, not a shell pattern, so just
	"[Ff][Oo][Rr][Ee][Vv][Ee][Rr]"
should work.  that, or
	".*[Ff][Oo][Rr][Ee][Vv][Ee][Rr]"
--
  Paul M. Aoki          |  University of California at Berkeley
  aoki@CS.Berkeley.EDU  |  Dept. of EECS, Computer Science Division (#1776) 
                        |  Berkeley, CA 94720-1776



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1995-07-06 19:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1995-06-28 14:54 trouble with "like" clause matthew@risetime.com <matthew@interaccess.com>
1995-07-06 19:11 ` Paul M. Aoki <aoki@CS.Berkeley.EDU>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox