mysql sql执行顺序

select distinct(question_id) from faq_question_action where action_id>=1327414 order by question_id ASC limit 0,100

===
from... where...group by... having.... select ... order by... limit

先从faq_question_action取得所有数据 然后根据条件筛选有用的 然后执行distinct操作去重 然后按question_id排序 然后从排序好的记录里分页给出limit

你可能感兴趣的:(mysql)