17,078
社区成员
发帖
与我相关
我的任务
分享
select decode(count(*),0,0,1) 记录 from test;
用count(*)+decode很容易啊!
15:24:54 SCOTT@orcl> select decode(num_rows,0,0,1) t from user_tables where ta
le_name='EMP';
T
----------
1
已选择 1 行。
已用时间: 00: 00: 00.01
15:24:50 SCOTT@orcl> select num_rows from user_tables where table_name='EMP';
NUM_ROWS
----------
25
已选择 1 行。