|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL QuestionCan anybody know how to set alias after 'where'?
select 1 as A, 2 as B,A-B as C from tbl where [B]=1 Hi Vincent,
I don't think that this is commonly supported, actually it depends on the database. -- Show quoteMiha Markic [MVP C#] - RightHand .NET consulting & development SLODUG - Slovene Developer Users Group www.rthand.com "Vincent Choy" <vinc***@exodus-tech.com> wrote in message news:O2R3kjd3EHA.3472@TK2MSFTNGP09.phx.gbl... > Can anybody know how to set alias after 'where'? > select 1 as A, 2 as B,A-B as C from tbl where [B]=1 > > Play with that as a subquery, something like this:
Select (Select X.1) as A, (Select X.2) as B, (Select X.A - X.B) as C FROM tbl as X WHERE X.2 = 1 Show quote "Vincent Choy" <vinc***@exodus-tech.com> wrote in message news:O2R3kjd3EHA.3472@TK2MSFTNGP09.phx.gbl... > Can anybody know how to set alias after 'where'? > select 1 as A, 2 as B,A-B as C from tbl where [B]=1 > > |
|||||||||||||||||||||||