【发布时间】:2018-02-15 13:28:39
【问题描述】:
帮我优化下面的sql,运行了好几个小时 数据库:sybase
select
too.toID,too.toName,frm.fromID,frm.fromName<br>
from
entityClientTempTable frm, entityClientTempTable too
where
frm.fromServerId = too.toServerId
and
frm.fromID < too.toID
and
lower(substring(frm.fromName, 0, CHARINDEX(''------'',frm.fromName))) like lower(too.toName))
entityClientTempTable 中的记录数:大约一百万
entityClientTempTable 表上没有索引
entityClientTempTable 是一个临时表。
【问题讨论】:
-
您能否详细说明您的查询的预期结果?最终目标是什么?
标签: sql join query-optimization sap-ase