OK, the list can be filtered this way in ColdFusion before you ship it off
to the
DataBase Machine to run your query...
<cfset My_Keyword_List = "">
<cfloop list="#Keywords#" index="Current_Keyword">
<cfif not listfind(My_Keyword_List,Current_Keyword)>
<cfset My_Keyword_List =
listappend(My_Keyword_List,Current_Keyword)>
</cfif>
</cfloop>
But, in the query you show, yes, DISTINCT would be ok in this case, since
you are
only getting keywords from the database...
Heath
-----Original Message-----
From: Jason Larson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 10:05 AM
To: CF-Talk
Subject: RE: Removing Duplicate Values in a List
I've have tried this and it doesn't work. Here's a little better
explaination.
<cfquery name="Keywords" datasource="#DS#" username="#DSUsername#"
password="#DSPassword#">
SELECT Keywords
FROM Photos
</cfquery>
<!--- Creates a list and Alphabetizes out of the database, i.e.
bear,elk,wolve --->
<cfset KeywordList = ListSort(ValueList(Keywords.Keywords), "textnocase")>
Know is where I run into a problem. This list will contain duplicate values
that I want to replace
Any ideas?
Thanks for your time
Jason Larson
[EMAIL PROTECTED]
-----Original Message-----
From: Jason Lees (National Express)
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 7:31 AM
To: CF-Talk
Subject: RE: Removing Duplicate Values in a List
use the Select Distinct option thats in SQL?
Select Distinct COl1,Col2,...etc from My_Table where x=y
Jason Lees
National Express Ltd
E-Mail : [EMAIL PROTECTED]
-----Original Message-----
From: Jason Larson [mailto:[EMAIL PROTECTED]]
Sent: 27 February 2001 14:19
To: CF-Talk
Subject: Removing Duplicate Values in a List
I have a List that is generated from a query, How about do I remove
duplicate values within the list? I couldn't find any kind of reference to
this anywhere not even in Ben's Bible. Thanks for your help!
Jason Larson
[EMAIL PROTECTED]
406-728-4422
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists