V Vincent Choy Dec 9, 2004 #1 Can anybody know how to set alias after 'where'? select 1 as A, 2 as B,A-B as C from tbl where =1
D Duncan Welch Dec 9, 2004 #2 Ignoring the part "2 AS B" means that B can never equal 1 in your where clause, I think what you're looking for is a subquery: SELECT A, B, A-B AS C FROM (SELECT 1 AS A, 2 AS B FROM tbl ) MySubQuery WHERE B = 1 Hope this helps! Dunc
Ignoring the part "2 AS B" means that B can never equal 1 in your where clause, I think what you're looking for is a subquery: SELECT A, B, A-B AS C FROM (SELECT 1 AS A, 2 AS B FROM tbl ) MySubQuery WHERE B = 1 Hope this helps! Dunc