Jason,

In order for the DISTINCT keyword to work, the query must be ordered.

This query should work:

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

        <cfset KeywordList = ValueList(Keywords.Keywords)>


Craig

> -----Original Message-----
> From: Jason Larson [SMTP:[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