[thelist] cfoutput query

Chris Hayes chris at londonweb.net
Fri Nov 24 11:24:59 CST 2000


Think something like this might work, if I understand the problem.

SELECT  client.checkvalue AS checkvalue, client.othervalue.AS, othervalue,
getother
FROM client INNER JOIN otherTable ON client.checkvalue= otherTable.getother;


The query is then populated with your getother field values

HTH

Chris

----- Original Message -----
From: "Ed Nolan" <ed at nolans.net>
Newsgroups: evolt
Sent: Friday, November 24, 2000 5:10 PM
Subject: [thelist] cfoutput query


> 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
>
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list