sqlserver中 if(条件)sql语句
在oracle中不知道怎么写在sqlserver中这样
if(select count(*) from talbe)>1 select * from table
在oracle中怎么写?

解决方案 »

  1.   

    if select count(*) from talbe>1 then
       select *from table ;
      

  2.   

    if (select count(*) from talbe)>1 then
       select *from table ;
      

  3.   

    为什么报无效的sql语句啊?
      

  4.   

    if (select count(*) from talbe)>1 then
       select *from table ;
    end if;
    没试过,不行的话就
    declare
    aaa  int;select count(*) into aaa from table;
    if aaa>1 then
       select *from table ;
    end if;
      

  5.   

    在oracle中, 不能够这样写只能先定义一个变量 a
    然后 select count(*) into a from tablename再用ifif a > 1 then
    ...
      

  6.   

    你太基础了, 有些问题应该自己能查出来的 select count(*) into a from tablenameif a > 1 then
    .....
    不是不可以, 而是 select count(*) into a from tablename这句的a前面我漏写了":"
    应为 select count(*) into :a from tablename就可以了.