I have this simple SQL statement:
select Expr1.value - Expr2.value FROM
(SELECT
Expr1 = (SELECT COUNT(ID) FROM Table1),
Expr2 = (SELECT COUNT(ID_) FROM Table1 WHERE (UPDATED > CREATED))
)
It throws me the errors:
The multi-part identifier ‘Expr1.value’ could not be bound
The multi-part identifier ‘Expr2.value’ could not be bound
Where is my mistake ?
I read in Stackoverflow but many topics refer to INNER JOIN statements only. I am looking for to do difference between Expr1 and Expr2. (and show the result)
Try:
This:
returns result set with columns named
Expr1andExpr2and this way you should refer to them. Anyway I preferasfor aliasing columns: