首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

sqlserver转oracle,该如何解决

2012-06-06 
sqlserver转oracleDECLARE @count INTSELECT @count COUNT(*) FROM testsSELECT @count AS totalCounts,

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;
[解决办法]

探讨

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

热点排行