当前位置: 代码迷 >> Oracle开发 >> sqlserver转oracle,该如何解决
  详细解决方案

sqlserver转oracle,该如何解决

热度:13   发布时间:2016-04-24 07:28:30.0
sqlserver转oracle
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;
------解决方案--------------------
探讨

还是有错,我没明白你的意思,你是创建临时表吗?

  相关解决方案