"INTERSECT" is not a MySQL keyword. If I read your logic correctly, you
seem to want:
SELECT *
FROM table
WHERE (field_a like '%keyword1%' OR field_b like '%keyword1%')
AND (field_a like '%keyword2%' OR field_b like '%keyword2%')
This statements tests that both keyword1 and keyword2 both appear in the
same record in either field_a or field_b. If that is not what you
intended, just write out a description of condition you need to find and
we will try to help you make a query to do that.
Yours,
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
"L a n a" <[EMAIL PROTECTED]> wrote on 07/18/2004 09:20:20 PM:
> Hello,
> I'm trying to find a resulting set for searching two keywords, like:
>
> Select * from table where filed_a like '%keyword1%' OR field_b like
> '%keyword1%' INTERSECT (Select * from table where filed_a like
'%keyword2%'
> OR field_b like '%keyword2%').
> This statement gives an error in syntax.
> What is right way to write this kind of logic in query?
>
> Thank you,
>
> _________________________________________________________________
> MSN Premium: Up to 11 personalized e-mail addresses and 2 months FREE*
> http://join.msn.com/?pgmarket=en-
> ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.
> com/enca&HL=Market_MSNIS_Taglines
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
>