SQL优化

先筛选再连接

SELECT
	d.NAME,
	v.phone 
FROM
	( SELECT d.* FROM tablea d LIMIT #{currIndex} , #{pageSize}
	) AS d
	LEFT JOIN tableb v ON v.user_id = d.user_id 
WHERE
	v.del_flag = '0' 
ORDER BY
	d.add_time DESC
上一篇:攻防世界ics-06&burpsuite爆破bug


下一篇:SQL语句大全