Another SQL question

Bob Sneidar bobs at twft.com
Fri Jan 30 20:50:41 EST 2009


Never mind I figured it out. You have to use MATCH() AGAINST() with  
MyISAM tables and the columns you search have to have fulltext indexes  
created for them. Works like a charm though.

SELECT * FROM myISAMTable MATCH (deptid) AGAINST ('ACCT,FROF,DEV')

returns records whose deptid is in 'ACCT,FROF,DEV'

Bob Sneidar
IT Manager
Logos Management
Calvary Chapel CM

On Jan 30, 2009, at 5:19 PM, Bob Sneidar wrote:

> Hi all.
>
> I am trying to find a way to query a table whose column is in a list
> of values. There is nothing in any SQL book or manual that says how to
> do this. It looks like they want you to build a complex SQL statement
> like:
>
> SELECT * FROM myTable WHERE myColumn = 'this' OR myColumn = 'that' or
> mycolumn...
>
> That would work for a few items but what about for a HUGE list of
> several hundred items? I know Revolution has the syntax "is in" or
> "contains". Does SQL have a similar function?
>
> I tried "LIKE" as in:
>
> SELECT * FROM myTable WHERE myColumn LIKE 'this,that,the other thing'
>
> That returns empty cursors even though those values are in the table
> plain as day.
>
> Bob Sneidar
> IT Manager
> Logos Management
> Calvary Chapel CM
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list