[thelist] [SQL] SELECT Question

Brian Cummiskey Brian at hondaswap.com
Thu May 26 14:53:53 CDT 2005


Jacques Capesius wrote:
> Hi folks,
> 

> [Column 'Sales'] / [Column 'Quota'] AS 'Percent to Quota'
> FROM...
> ------------------------------------------------------------
> 
> Is there a way to directly refer to a SELECT clause item by alias or
> column number (as in ORDER BY 1,2) so I can avoid having to write
> another set of subqueries to calculate the result of subquery 1 /
> subquery 2?

I looked for the exact same question a couple weeks back and came up 
with nothing.

i actually made a post about it on my car board.
http://www.hondaswap.com/forums/index.php?showtopic=56113

i was trying to do the same thing--  come up with a percent figure based 
on the division of two results.

if you come up with an answer, let me know.  The SP i wrote is horrible. 
  haha



More information about the thelist mailing list