[thelist] cfoutput query

Ed Nolan ed at nolans.net
Fri Nov 24 11:09:56 CST 2000


Greetings,

Does ANYBODY know a way of performing the equivalent of a "nested query
output".  Possibly I can illustrate the question better by providing a
simple example.

<!-- START -->
<!-- FIRST THE INITIAL QUERY -->
     <cfquery name="check" datasource="dsn">
     SELECT  client.checkvalue AS checkvalue, client.othervalue.AS
othervalue
     FROM client
     WHERE checkvalue = #somevalue#
     </cfquery>
<!-- OUTPUT THE RESULTS -->
     <cfoutput query="displayvalue" group="somevalue">
     This displays of all of the occurrences of the #check.checkvalue#
variable.
     Based on the value of this variable, the variable #getother# should be
displayed for each records where "getother" is the respective value from
another table.
<!-- END-->

Supposing, the cfoutput returns three records for the #check.checkvalue#
variable.  Each occurrence of the #check.checkvalue#  variable needs to be
displayed with the respective #getother# which resides in another table.

The challenge is that the #getother# variable is the result of a query from
another table.  I would combine it with the initial "check" query but the
value of the "getother" variable is dependent upon the results of the
"check" query.

My question: How can I query and display the respective #getother# value for
each record returned from the "checkvalue" cfoutput?

Any suggestions, leads or shreds of evidence greatly appreciated.  Please
and thanks in advance for anything you can throw this way.

--- Ed Nolan





More information about the thelist mailing list