Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在数据类型编号的变量中使用表中的记录总数,但如果我使用以下语句,我将无法做到这一点:
row_num number; row_num := select count(*) from emp;
我正在尝试在程序中使用它..正确的方法是什么?
假设这是在 PL/SQL 过程中,正确的语法是:
SELECT COUNT(*) INTO row_num FROM emp;
声明一个变量并按照查询将计数复制到一个变量
DECLARE row_num NUMBER(10) := 0; select count(*) into row_num from emp;