Mixing proximity and intersection searches?

Post Reply
jkj2001
Posts: 142
Joined: Fri Mar 29, 2002 1:39 pm

Mixing proximity and intersection searches?

Post by jkj2001 »

Hi guys,

A question about mixing proximity and intersection searches: I'd like to return rows from my table where FIELD01 is like either 'David*' or 'Johnson*' and at least one of the words 'Honda' 'Toyota' or 'Hyundai' are within 20 characters of the first term.

I've been mulling it over, and what I thought might work would be something like this:

select * from mytable where (FIELD01 like (David* or Johnson*) w/20 Hyundai Honda Toyota @0)

That's probably incorrect syntax, but would this do the trick instead?

select * from mytable where (FIELD01 like (+David* w/20 Hyundai Honda Toyota @0) or FIELD01 like (+Johnson* w/20 Hyundai Honda Toyota @0))

Thanks!
jkj2001
Posts: 142
Joined: Fri Mar 29, 2002 1:39 pm

Mixing proximity and intersection searches?

Post by jkj2001 »

Whoops-- mixed up my parentheses in that second statement. I meant to type something like this:

....(FIELD01 like '+David* w/20 Hyundai Honda Toyota @0') or (FIELD01 like '+Johnson* w/20 Hyundai Honda Toyota @0')...
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Mixing proximity and intersection searches?

Post by John »

Yes, the restated should work, however:

FIELD01 like '@0 David* Johnson* +(Hyundai,Honda,Toyota) w/20'

should also work in a single like.
John Turnbull
Thunderstone Software
Post Reply