List:General Discussion« Previous MessageNext Message »
From:Jan Steinman Date:October 3 2012 11:08pm
Subject:Accessing Column Aliases In Other Columns?
View as plain text  
I would like to refer to calculated columns in other columns. I thought a column alias
would do it, but apparently they're only for aggregation, like GROUP BY.

Other than repeating the entire calculation, what techniques are available for accessing
such a calculation?

I'm calculating an electric bill, based on meter readings. I need to subtract two meter
readings, and use that number in several other calculations, for example.

----------------
:::: Transformation is not what happens once we've "changed"; it's coming out of the dark
and seeing what we've got and relating to it appropriately and clearly. If we've got a
funnel in our hands but we think it's a bucket, we're going to keep losing things we
value. If we know we've got a funnel, then we stick one finger in the hole and use it
like a bucket to get by in the absence of one. We're "transformed" when we fully know who
we are — or, even more important, who we are not. -- Rick Lewis
:::: Jan Steinman, EcoReality Co-op ::::




Thread
Accessing Column Aliases In Other Columns?Jan Steinman3 Oct
  • RE: Accessing Column Aliases In Other Columns?Rick James3 Oct
RE: Accessing Column Aliases In Other Columns?Jan Steinman6 Oct