sql - There is a way to use a calculated field in the where clause? -
there way use calculated field in clause ?
i want like
select a, b, a+b total ( select 7 a, 8 b dual union select 8 a, 8 b dual union select 0 a, 0 b dual ) total <> 0 ;
but ora-00904: "total": invalid identifier.
so have use
select a, b, a+b total ( select 7 a, 8 b dual union select 8 a, 8 b dual union select 0 a, 0 b dual ) a+b <> 0 ;
logically, select
clause 1 of last parts of query evaluated, aliases , derived columns not available. (except order by
, logically happens last.)
using derived table away around this:
select * (select a, b, a+b total ( select 7 a, 8 b dual union select 8 a, 8 b dual union select 0 a, 0 b dual) ) total <> 0 ;
Comments
Post a Comment