SQL Server转过来了,120分求救
declare
V_A int
begin
V_A:=5;
select V_A as 金额 from dual;----------为什么不行了
end;
第二:
Create or replace procedure TK
is
begin
select * from test;
end;
----------------------------------为什么这个procedure不能执行,应该怎么改了
3.
http://community.csdn.net/Expert/topic/4297/4297925.xml?temp=.262829
----------------------------------------
2.
表test
----------------------------
学生编号 科目 分数
001 语文 78
002 外语 98
003 数学 94
001 数学 85
002 数学 56
----------------------------
得到结果如下:
学生编号 语文 外语 数学
001 78 0 85
002 0 98 56
003 0 0 94
小弟这样不知为什么不行:
declare
begin
V_Str varchar(5000)
V_str:='select 学生编号';
select V_str+'sum(case 科目 when '''+科目+''' then 分数 else 0 end)''+科目+'''
into V_str from (select distinct 科目 from test)a;
V_Str:=V_str+' from test group by 学生编号;
exec(V_Str);
end;
------------------------------