🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.ms-sqlserver
Article #108

referance to a Calculate field in SQL Server

#108
From: Yoni Almog
Date: Wed, 23 Aug 2000 00:00
15 lines
1374 bytes
I have a table with one field: mark.
I would like to create a quary with 2 calculated fields that the second is
based on the first.

SELECT Mark,
   Mark * 3 + 1 AS EXPR1, EXPR1  * 2  AS EXPR2
FROM Students

This code does not work on SQL Server.
It says: "Invalid coloum name EXPR1"
How can i refer to EXPR1 in this quary?
Thanks

mail me to:
ya94@hotmail.com
Technical Details
Message-ID: <39a3e669@news.bezeqint.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 110e3b,572a8a44e875726d,start
X-Google-Attributes: gid110e3b,public
X-Google-Thread: ff490,572a8a44e875726d,start
X-Google-Attributes: gidff490,public
X-Google-Thread: f645d,572a8a44e875726d,start
X-Google-Attributes: gidf645d,public
X-Google-Thread: 104de1,572a8a44e875726d,start
X-Google-Attributes: gid104de1,public
X-Google-Thread: 1143a7,572a8a44e875726d,start
X-Google-Attributes: gid1143a7,public
From: "Yoni Almog" <ya94@hotmail.com>
Subject: referance to a Calculate field in SQL Server
Date: 2000/08/23
Message-ID: <39a3e669@news.bezeqint.net>
X-Deja-AN: 661562190
X-Trace: 23 Aug 2000 17:57:45 +0200, bzq-166-125.bezeqint.net
Organization: Bezeq International Ltd.
X-MSMail-Priority: Normal
X-Priority: 3
Newsgroups: comp.databases.ms-sqlserver,comp.lang.basic.visual,comp.lang.basic.visual.database,comp.lang.basic.visual.misc,cz.comp.microsoft.sql
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300