From: Jan Steinman Date: October 3 2012 11:08pm Subject: Accessing Column Aliases In Other Columns? List-Archive: http://lists.mysql.com/mysql/228309 Message-Id: <70E5E9B3-CD2D-4613-AB21-A3A26C45D8D4@Bytesmiths.com> MIME-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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 =97 or, even more important, who we are not. -- = Rick Lewis :::: Jan Steinman, EcoReality Co-op ::::