SELECT COUNT(ANOTHER SELECT QUERY) FROM DUAL.
我们能以这种方式获得结果还是有其他方式?
答案 0 :(得分:3)
一个例子可以帮助您
SQL> create table tabTest as (select 1 x from dual);
Table created.
SQL> select count( select * from tabTest ) from dual;
select count( select * from tabTest ) from dual
*
ERROR at line 1:
ORA-00936: missing expression
SQL> select count(*) from (select * from tabTest);
COUNT(*)
----------
1
答案 1 :(得分:1)
您可以使用派生表(又名“子查询”)
select count(*)
from (
.... your query here ...
);