SELECT tblT.Tick, First(tblB.BDF) AS FirstOfBDF
FROM tblT INNER JOIN tblB ON tblT.Tick = tblB.Tick
GROUP BY tblT.Tick;
我的访问表(tblB)按Tick排序,然后由BDF排序。为什么它不能检索到正确的数据呢?
答案 0 :(得分:2)
除非您明确提及Order by
,否则无法保证对表进行排序。
select top 1 tblT.Tick, First(tblB.BDF) AS FirstOfBDF
from FROM tblT INNER JOIN tblB ON tblT.Tick = tblB.Tick
GROUP BY tblT.Tick
Order by tblt.Tick ;