高分:含千万条数据的表查询的性能问题
A表:
symbol tdate tclose
000001 20070725 1.23
000002 20070726 0.23
000001 20070723 2.3
000004 20070618 1.4
B表:
symbol
000001
000002
000004
输入2007-07-26
输出
symbol tdate tclose lclose
000001 20070725 1.23 2.3
000002 20070726 0.23 NULL
000004 20070618 1.4 NULL
symbol从B表中取现出,tdate为最新的tclose,
lclose为第二新的tclose,
tclose不为0或NULL
A表的记录数为2000万条左右,现在主要是一个效率的问题.不知道怎么才能再快点.