以下語句在SQL 7.0上通過,為什么在Delphi 5.0的ADO(ADOQuery)上無法執行,請高手指點!!!
*****************************************
declare @a int,@b int //此處已經不可以了,??
select identity(int) id0,name,score into #temp1 from test1
where score <60 order by name; --不及格select identity(int) id0,name,score into #temp2 from test1
where score >=60 and score <80 order by name; --60~80select identity(int) id0,name,score into #temp3 from test1
where score >=80 and score <=100 order by name; --80~100select @a = count(*) from #temp1
select @b = count(*) from #temp2
if (@a > @b)
select a.name,a.score,b.name,b.score,c.name,c.score from #temp1 a
full outer join #temp2 b on a.id0 = b.id0
full outer join #temp3 c on a.id0 = c.id0
else
select a.name,a.score,b.name,b.score,c.name,c.score from #temp1 a
full outer join #temp2 b on a.id0 = b.id0
full outer join #temp3 c on b.id0 = c.id0 drop table #temp1,#temp2,#temp3
**************************************************************************
*****************************************
declare @a int,@b int //此處已經不可以了,??
select identity(int) id0,name,score into #temp1 from test1
where score <60 order by name; --不及格select identity(int) id0,name,score into #temp2 from test1
where score >=60 and score <80 order by name; --60~80select identity(int) id0,name,score into #temp3 from test1
where score >=80 and score <=100 order by name; --80~100select @a = count(*) from #temp1
select @b = count(*) from #temp2
if (@a > @b)
select a.name,a.score,b.name,b.score,c.name,c.score from #temp1 a
full outer join #temp2 b on a.id0 = b.id0
full outer join #temp3 c on a.id0 = c.id0
else
select a.name,a.score,b.name,b.score,c.name,c.score from #temp1 a
full outer join #temp2 b on a.id0 = b.id0
full outer join #temp3 c on b.id0 = c.id0 drop table #temp1,#temp2,#temp3
**************************************************************************
解决方案 »
- 白皮书:Delphi2009中新的DataSnap
- 高分求解:两台服务器之间的数据表更新问题
- 关于在dbgrid 动态改变某一个网格的颜色(不是某一行一列)
- HttpCli就他妈是渣。让我忙了一天一夜都没搞定!!!!!
- 关于对adoconnection控件的connectionstring属性动态赋值的问题。
- 关于Pardox数据库的问题!!!!!
- 菜鸟三个角角了,,,散分,,,散点分给大家
- 100分!!!主调程序与dll如何共享一个BDE的数据库的连接(TDatabase TQuery...)
- 请问在delphi中用了第三方控件,编译后的可执行文件在其它没有这个第三方的控件的机器上能不能运行?在线等待!
- 请高手们帮忙
- 为什么我的一个窗体(formstyle=fsstayontop),在别的窗体进行操作时老是会莫名其妙的消失!
- 关于TreeNode的AbsoluteIndex的问题,急,急,急。请高手帮忙,绝不赊帐
/////////declare @a int,@b int //此句放在后面
select identity(int) id0,name,score into #temp1 from test1
where score <60 order by name; --不及格select identity(int) id0,name,score into #temp2 from test1
where score >=60 and score <80 order by name; --60~80select identity(int) id0,name,score into #temp3 from test1
where score >=80 and score <=100 order by name; --80~100declare @a int,@b int
select @a = count(*) from #temp1
select @b = count(*) from #temp2
if (@a > @b)
select a.name,a.score,b.name,b.score,c.name,c.score from #temp1 a
full outer join #temp2 b on a.id0 = b.id0
full outer join #temp3 c on a.id0 = c.id0
else
select a.name,a.score,b.name,b.score,c.name,c.score from #temp1 a
full outer join #temp2 b on a.id0 = b.id0
full outer join #temp3 c on b.id0 = c.id0 drop table #temp1,#temp2,#temp3多謝各位的提示