SQL Question

  • Thread starter Thread starter Vincent Choy
  • Start date Start date
V

Vincent Choy

Can anybody know how to set alias after 'where'?
select 1 as A, 2 as B,A-B as C from tbl where =1
 
Hi Vincent,

I don't think that this is commonly supported, actually it depends on the
database.
 
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
 
Back
Top