House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

Checking for a duplicate value question

Author:
Christopher Watson
05/03/2012 12:39 PM

In reading through this thread, it appears as though one of your lists (not clear whether it's the short or long list) is sourced from database, and the other not. But if you've got one list of key column values in a CF List var, then you should be able to query the database to pull out everything NOT IN that list. Something like: <cfquery name="UniqueRecords" datasource="MyDatasource">     SELECT DISTINCT SomeColumn     FROM SomeTable     WHERE SomeColumn NOT IN (<cfqueryparam cfsqltype="cf_sql_varchar" list="yes" value="#OtherList#">) </cfquery> Then ValueList the column from that result, append your other list, and you should have your comprehensive list, with no dupes: <cfset ComprehensiveList = "#ValueList(UniqueRecords.SomeColumn)#,#OtherList#"> -Christopher > I'm checking to be sure there are any duplicates between the two lists > ... > [other content and sample code clipped]


Search cf-talk

May 20, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference