sqlserver中 if(条件)sql语句
在oracle中不知道怎么写在sqlserver中这样
if(select count(*) from talbe)>1 select * from table
在oracle中怎么写?
在oracle中不知道怎么写在sqlserver中这样
if(select count(*) from talbe)>1 select * from table
在oracle中怎么写?
select *from table ;
select *from table ;
select *from table ;
end if;
没试过,不行的话就
declare
aaa int;select count(*) into aaa from table;
if aaa>1 then
select *from table ;
end if;
然后 select count(*) into a from tablename再用ifif a > 1 then
...
.....
不是不可以, 而是 select count(*) into a from tablename这句的a前面我漏写了":"
应为 select count(*) into :a from tablename就可以了.