DECLARE @count INT
SELECT @count = COUNT(*) FROM tests
SELECT @count AS totalCounts,* FROM tests
这个是sqlserver语法。在oracle中,怎么写?
------解决方案--------------------
/*
DECLARE @count INT
SELECT @count = COUNT(*) FROM tests
SELECT @count AS totalCounts,* FROM tests
*/
declare
cnt int := 0;
begin
select count(1) into cnt from tests;
select cnt as totalcounts,字段列表(请一一写出来 ORACLE不支持单表使用字段+*的用法) from tests;
end;
------解决方案--------------------