Les,

There are probably a number of ways you could go about this.  One way would
be to use a 'LIKE' operator (which does slow down performance - FYI).
Something like this:

SELECT columnlist FROM tablename 
WHERE mycolumn LIKE '%,23,%' OR mycolumn LIKE '23,%' OR mycolumn LIKE '%,23'

Again, this could be slow depending on how large your table could grow.  Not
only is LIKE going to slow it down, but so is the usage of OR.

If you are not looking at a large subset of records and you can narrow them
down some other way, you could use a Query of Queries.  First, pull the
'set' of records you want to search with a regular query, and then use a
query of queries to do your LIKE comparison.  This could be much faster in
the long run.

There may be other ways, but this is the first one that comes to mind. If I
think of anything else I'll pass it on.

Dave

-----Original Message-----
From: Les Irvin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, January 27, 2007 12:23 PM
To: CF-Talk
Subject: Re: Querying a delimited text field


I'm trying to find it using sql within a <cfquery> tag,  that's why I'm
stumped.

On 1/27/07, Jim Wright <[EMAIL PROTECTED]> wrote:
>
> Les Irvin wrote:
> > Novice question here.
> >
> > I need to write a query to find a single integer in a field of 
> > delimited integers, say "23,25,27,29".  How is this done in Cold
> Fusion?  FindOneOf?
> > FindNoCase?  Can anyone advise?
> >
>
> In CF, you would probably use ListFind...but are you trying to find 
> this on the CF side, or in your database query?
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267841
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to