|
|
|
Количество таблиц в 6.5
|
|||
|---|---|---|---|
|
#18+
Есть запрос типа SELECT getdate() DateEdit, case when not exists (select sm.DezID from g_Order sm where sm.RegID = b.RegID AND sm.Registrate=b.Registrate and sm.ItemID=b.ItemID) and (b.ItemID in (3,4,6)) then (select sm.DezID from mt_objects sm where sm.RegID = b.RegID AND sm.Registrate=b.Registrate and sm.EffID=1) when not exists (select sm.DezID from g_Order sm where sm.RegID = b.RegID AND sm.Registrate=b.Registrate and sm.ItemID=b.ItemID) and (b.ItemID in (18,19)) then (select sm.DezID from mt_objects sm where sm.RegID = b.RegID AND sm.Registrate=b.Registrate and sm.EffID=4) else (select sm.DezID from g_Order sm where sm.RegID = b.RegID AND sm.Registrate=b.Registrate and sm.ItemID=b.ItemID) end as DezID, case when not exists (select sm.doc_no from g_Order sm where sm.RegID = b.RegID AND sm.Registrate=b.Registrate and sm.ItemID=b.ItemID) and (b.ItemID in (33,44,61)) then (select sm.doc_no from mt_objects sm where sm.RegID = b.RegID AND sm.Registrate=b.Registrate and sm.EffID=1) when not exists (select sm.doc_no from g_Order sm where sm.RegID = b.RegID AND sm.Registrate=b.Registrate and sm.ItemID=b.ItemID) and (b.ItemID in (1804,1904)) then (select sm.doc_no from mt_objects sm where sm.RegID = b.RegID AND sm.Registrate=b.Registrate and sm.EffID=4) else (select sm.doc_no from g_Order sm where sm.RegID = b.RegID AND sm.Registrate=b.Registrate and sm.ItemID=b.ItemID) end as doc_no, orderNum.ID,orderNum.RegID, orderNum.Registrate, (select s.ServiceID from ServiceTypes s where s.ItemID=b.ItemID), round(b.older_num/1000,2) as NSUMM1,round(b.InitPart/1000,2) as NSUMM2 FROM (select distinct c.doc_no, c.ID, c.RegID, c.Registrate from Init a, mt_objects c where c.DID=14337 and a.RegID = c.RegID AND a.Registrate=c.Registrate and a.DateBegin<='10.01.2002' and a.DateEndFact>'10.02.2002' AND a.resultid in (1,2) and a.statusid=1 and a.dotypeid<9 and a.ID=56) as orderNum, rt_xecute b WHERE orderNum.RegID = b.RegID AND orderNum.Registrate=b.Registrate and not b.ItemID in (12,17) and b.older_num<>0 and b.InitPart<>0 ORDER BY doc_no исполняющийся на 6.5 версии SQL Server. При исполнении естественно ругается на количество таблиц (>16), учавствующих в запросе. Каким либо образом можно обойти ограничение без глобального переписования с использованием вьюшек и временных таблиц ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.10.2002, 12:27:31 |
|
||
|
|

start [/forum/topic.php?fid=46&fpage=3393&tid=1819457]: |
0ms |
get settings: |
5ms |
get forum list: |
10ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
17ms |
get topic data: |
7ms |
get forum data: |
2ms |
get page messages: |
28ms |
get tp. blocked users: |
1ms |
| others: | 199ms |
| total: | 273ms |

| 0 / 0 |
