以無限的時間下面是我的SQL查詢
SQL查詢與使用順序時
select top(10) ClientCode
FROM (((Branch INNER JOIN BusinessLocation ON
Branch.BranchCode=BusinessLocation.BranchCode)
INNER JOIN Center ON BusinessLocation.LocationCode = Center.LocationCode)
INNER JOIN Groups ON Center.CenterCode = Groups.CenterCode)
INNER JOIN Client ON Groups.GroupCode = Client.GroupCode
WHERE
((Client.CBStatus) IS NULL) AND ((Branch.PartnerName) in
('SVCL','Edelweiss'))
order by Client.ClientCode DESC
當我爲了不運行它通過它運行良好,但爲了通過它沒有完成執行。這是爲什麼?
你的桌子有多大?你有Client.ClientCode上的索引嗎? –
合計1324738條記錄,Client.ClientCode上沒有索引 – Saurabh
在連接列上添加索引。 –