I guess that is the only way to do that. I was hoping not to have to list 
all the columns I needed but to use the *. Thanks any way guys :)

At 09:49 AM 9/24/2002 +0100, you wrote:
>hi john
>try aliasing the value you want to pull out, there is a way which will
>negate the need to name all the columns you want to select, but I can't
>remember it off the top of my head.  The code below should work, let me kow
>if you have any problems
>
>Mark
>
><cfquery name="getRep"
>    datasource="#session.datasource#"
>    dbserver="#session.dbserver#">
>   SELECT b.total, d.total AS second_total
>   FROM trip_flow_breakdown b, trip_flow_data d
>   WHERE b.wid = #attributes.wid# AND b.fid = #attributes.fid# AND b.id =
>#attributes.id#
>   AND d.wid = #attributes.wid# AND d.fid = #attributes.fid#
></cfquery>
>
><cfoutput>#getRep.second_total#</cfoutput>
>
>-----Original Message-----
>From: John Gedeon [mailto:[EMAIL PROTECTED]]
>Sent: 24 September 2002 01:21
>To: CF-Talk
>Subject: Two tables same column name?
>
>
>I have a query where i join two tables. and both tables have a field which
>are titled the same but each table has a different value. is there a way
>for pulling the two different values out in cold fusion or do i have to use
>multiple selects??
>
><cfquery name="getRep"
>    datasource="#session.datasource#"
>    dbserver="#session.dbserver#">
>   SELECT *
>   FROM trip_flow_breakdown b, trip_flow_data d
>   WHERE b.wid = #attributes.wid# AND b.fid = #attributes.fid# AND b.id =
>#attributes.id#
>   AND d.wid = #attributes.wid# AND d.fid = #attributes.fid#
></cfquery>
>
>    the field i want to get is total but if i use
>   <cfoutput query="getRep">#total#</cfoutput> i only get the value of the
>first table in the from clause. any one have a solution?
>
><>< Proverbs 3:5 "Trust in the Lord with all your heart and lean not on
>your own understanding;"
>
>
>
______________________________________________________________________
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
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to