1.from<left_table>
2.on<jon_condition>
3.<join_type>join<right_table>
4.where<where_condition>
5.group by<group_by_list>
6.with{cube|rollup}
7.having<having_condition>
8.select
9.distinct<select_list>
10.order by<order_by_list>
11.limit<limit_number>
select (8)
distinct a.*,b.* (9)
from a (1)
left join b (3)
on a.id=b.id (2)
where a.id>0 (4)
order by a.id (10)