|
我把sql贴出来,大家看看有啥办法把sql简化一下,我写的sql实在太冗余了
select a1.casename 案例名称,a1.step_des 步骤描述,a1.expected 预期结果,a1.testdata 测试数据,a1.testdata_des 测试数据描述,b1.lujin 路径 from
(select test.TS_NAME casename,
dessteps.DS_DESCRIPTION step_des,
dessteps.DS_EXPECTED expected,
dessteps.DS_USER_08 testdata ,
dessteps.DS_USER_07 testdata_des,
list.AL_ITEM_ID from test ,dessteps,ALL_LISTS list
where test.TS_TEST_ID = dessteps.DS_TEST_ID
and list.AL_ITEM_ID = test.TS_SUBJECT) a1,
(select aa.aid aid,bb.AL_DESCRIPTION + '/'+ aa.path lujin from
(select distinct b.AL_FATHER_ID bid,a.AL_ITEM_ID aid,b.AL_DESCRIPTION+'/'+a.AL_DESCRIPTION path from
(select list.AL_ITEM_ID,list.AL_DESCRIPTION,list.AL_FATHER_ID from test ,ALL_LISTS list
where test.TS_SUBJECT = list.AL_ITEM_ID) a,ALL_LISTS b
where a.AL_FATHER_ID = b.AL_ITEM_ID) aa,all_lists bb
where bb.AL_ITEM_ID = aa.bid) b1
where b1.aid = a1.AL_ITEM_ID |
|