有两张表 结构分别是 b1: id, c_name, c_url, c_no; b2: id, d_url, d_date;
1 首页 /index.jsp 1 1 /index.jsp 2006-12-22 13:15:46.950
2 管理 /left.jsp 2 2 /left.jsp 2006-11-22 13:15:46.950
3 论坛 /bbs.jsp 3 3 /bbs.jsp 2006-10-22 13:15:46.950
4 /bbs.jsp 2006-9-22 13:15:46.950
5 /index.jsp 2006-9-22 13:15:46.950
结果 首页 2
管理 1
论坛 2这是我的写的sql select t.c_name,COUNT_BIG(ALL c.id) as c_count from
b1 t right join b2 c on t.c_url like c.d_url where '时间'< access_date and access_date< ‘时间’ group by c.c_name,c_no order by c.c_no问题我现在的数据有几千万条,反应很慢,求高手指教。。
1 首页 /index.jsp 1 1 /index.jsp 2006-12-22 13:15:46.950
2 管理 /left.jsp 2 2 /left.jsp 2006-11-22 13:15:46.950
3 论坛 /bbs.jsp 3 3 /bbs.jsp 2006-10-22 13:15:46.950
4 /bbs.jsp 2006-9-22 13:15:46.950
5 /index.jsp 2006-9-22 13:15:46.950
结果 首页 2
管理 1
论坛 2这是我的写的sql select t.c_name,COUNT_BIG(ALL c.id) as c_count from
b1 t right join b2 c on t.c_url like c.d_url where '时间'< access_date and access_date< ‘时间’ group by c.c_name,c_no order by c.c_no问题我现在的数据有几千万条,反应很慢,求高手指教。。
2, on t.c_url like c.d_url 改成 on t.c_url = c.d_url