Oracleでこれを行う方法はありますか?
select a.field1 || '_' ||
b.field2 || '_' ||
sum(c.field3)
from table1 a,
table2 b,
table3 c
where a.field1 || '_' ||
b.field2 || '_' ||
sum(c.field3) not in (select d.field1 || '_' ||
e.field2 || '_' ||
sum(f.field3)
from table4 d,
table5 e,
table6 f
where conditional_info_to_join_the_tables
group by d.field1, e.field2)
and conditional_info_to_join_the_tables
group by a.field1, b.field2
私が得るエラーは、where句で合計を使用できないことです
使ってみました
select a.field1 || '_' ||
b.field2 || '_' ||
sum(c.field3),
sum(c.field2) foo
from table1 a,
table2 b,
table3 c
where a.field1 || '_' ||
b.field2 || '_' ||
foo not in (select d.field1 || '_' ||
e.field2 || '_' ||
sum(f.field3)
from table4 d,
table5 e,
table6 f
where conditional_info_to_join_the_tables
group by d.field1, e.field2)
and conditional_info_to_join_the_tables
group by a.field1, b.field2
しかし、そのfooは識別された変数ではありませんでした。