Select top 10 A.*, B.cName as cInstrName, B.cModel From Table1 A Left Join Table2 B on A.cInstrID = B.cID where B.cName like '%三槽式冷热冲击试验箱%' order by A.iAutoID desc
--试下这样查 是不是快点?
Select top 10 A.*, B.cName as cInstrName, B.cModel
From Table1 A
Left Join Table2 B on A.cInstrID = B.cID
where B.cName like '%三槽式冷热冲击试验箱%'
------解决方案--------------------
Select top 10 A.*, B.cName as cInstrName, B.cModel From Table1 A Inner Join (select cID,cName ,cModel From Table2 B where cName like '%三槽式冷热冲击试验箱%' ) on A.cInstrID = B.cID
------解决方案--------------------
------解决方案--------------------
如果你只取 top 10的话 这样应该更快 Select top 10 A.*, B.cName as cInstrName, B.cModel From Table1 A Inner Join (select top 10 cID,cName ,cModel From Table2 B where cName like '%三槽式冷热冲击试验箱%' ) on A.cInstrID = B.cID
------解决方案--------------------
------解决方案-------------------- 快了吗
------解决方案-------------------- select top 10 cID,cName ,cModel From Table2 B where cName like '%三槽式冷热冲击试验箱%' 这样只要找出满足条件的 10 条就不找了,如果不加,就把所有的满足条件的数据都找出来。如果此表数据量大,有上百万的话,就慢了。