The DISTINCT function doesn't work.

I have a column within a database that is populated by a number of lists.
Here's my query and listsort :

<cfquery name="Keywords" datasource="#DS#" username="#DSUsername#"
password="#DSPassword#">
SELECT      DISTINCT Keywords
FROM        Photos
ORDER BY        Keywords
</cfquery>


<CFSET UNIQUE_LIST =
REReplace(ListSort(ValueList(Keywords.Keywords),"textnocase"),"([^,])(,\1)*"
,"\1","ALL")>


<!--- Here's the list it generates: bear,cubs,bird,bear,elk,deer,bird --->

My database is in Access, for some reason the DISTINCT Function doesn't work
with a column that is populated with a list.

Thanks for all your feedback

Jason Larson
[EMAIL PROTECTED]


-----Original Message-----
From: Adkins, Randy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 8:35 AM
To: CF-Talk
Subject: RE: Removing Duplicate Values in a List


Then in the Query, can you use the DISTINCT function?
That way there is no duplicates.


-----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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to