以无限的时间下面是我的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
在连接列上添加索引。 –