标题: 开发写的sql看不太懂啊---求教高手指点下 [打印本页] 作者: wdlcoke 时间: 2010-7-14 11:40 标题: 开发写的sql看不太懂啊---求教高手指点下 Select sum(nvl(a.amt, 0)) amt1,
sum(nvl(b.amt, 0)) amt2,
sum(nvl(a.amt, 0)) - sum(nvl(b.amt, 0)) amt3,
nvl(curbal, 0) amt4,
ORIGINALBAL amt5,
curbal amt6,
endbal amt7,
t.Account,
t.ctrlid,
t.bdglevel,
m.account oriaccount
From t_glbdgctrl t,
t_glrecord a,
t_glrecordbdg b,
(Select Distinct ctrlid, account
From (Select case
when b.amt > 0 then
a.fromctrlid
else
a.toctrlid
end ctrlid,
nvl(b.account, 0) account
From T_PLANMAIN a,
(select * from t_glrecord where dc = -1) b
Where a.billid = b.objectid(+)
And a.vchtypeid = b.vchtypeid(+)
and a.billid = 341923
and a.vchtypeid = 15)) m
Where t.ctrlid = m.ctrlid
And (t.ctrlid = a.ctrlid And a.dc = -1 And a.recid = b.recid(+))
Group By t.Originalbal,
t.Curbal,
t.Endbal,
t.Account,
t.Ctrlid,
t.Bdglevel,
m.Account作者: liangshi 时间: 2010-7-14 20:12
Select sum(nvl(a.amt, 0)) amt1,
sum(nvl(b.amt, 0)) amt2,
sum(nvl(a.amt, 0)) - sum(nvl(b.amt, 0)) amt3,
nvl(curbal, 0) amt4,
ORIGINALBAL amt5,
curbal amt6,
endbal amt7,
t.Account,
t.ctrlid,
t.bdglevel,
m.account oriaccount
From t_glbdgctrl t,
t_glrecord a,
t_glrecordbdg b,
m
Where t.ctrlid = m.ctrlid
And (t.ctrlid = a.ctrlid And a.dc = -1 And a.recid = b.recid(+))
Group By t.Originalbal,
t.Curbal,
t.Endbal,
t.Account,
t.Ctrlid,
t.Bdglevel,
m.Account
以上是t, a, b, m四个表做连接(join),然后对连接结果进行分组(group by)。
其中,表m是查询出来的,即 m =
(Select Distinct ctrlid, account
From m2)
其中,表m2也是查询出来的,即 m2 =
(Select case
when b.amt > 0 then
a.fromctrlid
else
a.toctrlid
end ctrlid,
nvl(b.account, 0) account
From T_PLANMAIN a,
(select * from t_glrecord where dc = -1) b
Where a.billid = b.objectid(+)
And a.vchtypeid = b.vchtypeid(+)
and a.billid = 341923
and a.vchtypeid = 15))
以上代码表明,m2是表a和表b做连接(join)的结果。其中b也是查询所得,即 b = (select * from t_glrecord where dc = -1)作者: wdlcoke 时间: 2010-7-16 17:59 标题: qtp求教 自己在录制好的QTP脚本中插入一行:“Browser("用户登录").Page("财政管理一体化信息系统(IFMIS)_3").WebTable("序号").ChildItem(3,7,"WebEdit",0).set"0.01"”
结果回放的时候报错:
Browser("用户登录").Page("财政管理一体化信息系统(IFMIS)_3").WebTable("序号").ChildItem(3,7,"WebEdit",0).set"0.01"