[thelist] Re-Using A Sub Query Value

Tab Alleman talleman at Lumpsum.com
Thu Jun 22 14:39:15 CDT 2006


Then you somehow must not have named it myTotal in your inner query.   Try highlighting your inner query in QA, executing it, and see what it says your column names are.

> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org]On Behalf Of Casey Crookston
> Sent: Thursday, June 22, 2006 3:36 PM
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] Re-Using A Sub Query Value
> 
> 
> 
> -----Original Message-----
> 
> To: peter at easylistbox.com; 
> Subject: Re: [thelist] Re-Using A Sub Query Value
> 
> I'm pretty sure it isn't... but you could make your whole query into a
> derived table to do something similar, like this:
> 
> SELECT
> 	someColumns
> ,	item4+myTotal AS grandtotal
> FROM (
> 	SELECT
> 		someColumns
> 	,	(SELECT blahblah) AS myTotal
> 	,	item4
> 	FROM blahblah WHERE blahblah
> ) mainquery
> 
> --------------------
> 
> I thought so too, but when it hits: item4+myTotal AS grandtotal, I'm
> told that myTotal is not a valid column name
> 
> :-(
> 
> Casey
> 
> -- 
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 



More information about the thelist mailing list