Another Neophyte SQL Question

Chuck Pelto cbpelto at pcisys.net
Thu Feb 15 12:55:09 CST 2007


Greetings,

If I have multiple search criteria in a textual field, how would I  
have to write the SQL query?

Case in point, I have a VText field with scads of text in it, say  
from on-line newspaper articles.

I want to find all the articles that mention "strawberries" and "gun  
laws".

Which is the proper syntax to use?

"....WHERE f1 LIKE %'" + value1 + "'% AND LIKE %'" + value2 + "'%" //  
mentioning the field only once for all values to be checked for

or

"....WHERE f1 LIKE %'" + value1 + "'% AND f1 LIKE %'" + value2 +  
"'%" // mentioning the field for every value to be checked for


Regards,

Chuck


More information about the Valentina mailing list