outside of using distinct in the oracle query just this:

<cfquery name="distinct" dbtype="query">
select distinct answer from myotherquery 
where parent_answer = '#myparentanswer#' 
</cfquery>

hth

isaac

------ Original Message ------ 
From: <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: Sep 02, 2003 05:35 PM
Subject: Re: SQL or CF Code help with extracting distinct values from a list

>Hi there,
>
>Trying to think of the best way to do this and I know the only way I can
>think of it will cause the web server to fall over due to the amount of
>data.....
>
>Problem.....
>
>Got a query returning something like this
>
>RESPONSE_ID                    ANSWER          PARENT_ANSWER
>1                              Hate                    Bluetit, Sparrow
>2                              Love                    Sparrow
>3                              Don't care              Bluetit, Crow
>4                              Hate                    Crow, Budgie
>
>What I need is SQL or CF code that I can run on the PARENT_ANSWER list
>that will give me all the distinct members of a list.
>
>ie the answer I would want from this would be 'Bluetit, Sparrow, Crow,
>Budgie'
>
>The records will be in the order of anything from a couple of thousand
>to a couple of hundred thousand...
>
>I've thought of using ValueList(query.PARENT_ANSWER) passing into a UDF
>that would extract the distinct values, but I know for a fact that in
>some of my high volume reports that using this sort of methid brings
>CF/WebServer to complete standstill.. (pretty obvious really, but it was
>a bad experience and I dont want to go there again, plus the solution
>will not work in this case)
>
>Anybody have a better method of extracting the distinct ones from a
>list?
>
>BTW CF5 and Oracle 8.1.7
>
>Cheers in advance...
>
>DC
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Reply via email to