You can do it using a QoQ and Select DISTINCT

OR

I wrote a couple of functions to do this. One day I will post them to
CFLib.....

/**
 * Case-sensitive function for removing duplicate entries in a list.
 * @param list      The list to be modified.
 * @return Returns a list.
 */
    function ListDeleteDuplicates(list) {
      var i = 1;
      var delimiter = ',';
      var returnValue = '';
      if(ArrayLen(arguments) GTE 2)
        delimiter = arguments[2];
          list = ListToArray(list, delimiter);
          for(i = 1; i LTE ArrayLen(list); i = i + 1)
        if(NOT ListFind(returnValue, list[i], delimiter))
        returnValue = ListAppend(returnValue, list[i], delimiter);

      return returnValue;
}


    /**
     * Case-INsensitive function for removing duplicate entries in a list.
     * @param list      List to be modified.
     * @return Returns a list.
     */
    function ListDeleteDuplicatesNoCase(list)
    {
      var i = 1;
      var delimiter = ',';
      var returnValue = '';
      if(ArrayLen(arguments) GTE 2)
        delimiter = arguments[2];
          list = ListToArray(list, delimiter);
      for(i = 1; i LTE ArrayLen(list); i = i + 1)
      if(NOT ListFindNoCase(returnValue, list[i], delimiter))
      returnValue = ListAppend(returnValue, list[i], delimiter);
      return returnValue;
    }


On Tue, May 13, 2008 at 11:46 AM, morchella <[EMAIL PROTECTED]>
wrote:

> awsome...
> thank you!
>
> now.. =]
> how would i remove doubles?
>
> <!--- List of Accessory's that are assigned to this product  --->
> <cfquery name="getAccessory" datasource="listit">
> SELECT DISTINCT ascList
> FROM dbo.list
> WHERE (specs_partnum IN (#columns#)) AND (ascList IS NOT NULL)
> </cfquery>
>
> gives me...
>
> ascList
> 132
> 135
> 135,132
>
> so my  list looks like
> aclist: 132,135,135,132
>
> just want 132,135
>
> thanks again!
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305173
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