1.sql server 函数中的 is  returns,

        create function f_check()
          returns  int
              as
           begin
                  declare @count int
                   select @count=count(S#)  from student   group by C#
                   return @count
            end
             go

    oracle sql 函数中是 is return

      function Get_Mid_Datetime_Number(v_serial_sn in varchar2)
    return number  is
         v_sql            number;
  begin
      select count(S#) into v_sql  from student   group by C#;
       return v_sql ;
  end Get_Mid_Datetime_Number;

2. sql server 没有rownum 用 top1-n

select   top 1 y.Supplier# as supplier   from buy as x,goods as y  where  x. G# in(
select G# from goods where Gtype='牙膏')
 and y.G#=x.G# 
group by  y.Supplier#

评论
发表评论

提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则

您还没有登录,请登录后发表评论

心似海
搜索本博客
博客分类
最近加入圈子
存档
最新评论