将查询的结果集放在
1.sql查询不同表的某个字段,进行计算并将计算结果直接查询出来,借助虚表dual
select ((select t1. a from table_1 t1 where t. id = 1) -
(select t2.b from table_2 t2 where t2.id = 1)) fromdual
2.sql直接将多个表的不同结果作为新的结果集直接查询
select
(select t1.a from table_1 t1 where t1.id = 1 ),
(select t2.b from table_2 t2 where t2.id = 2)
from dual