一个基本查询的逻辑过程:
(8) SELECT (9) DISTINCT (11)
(1) FROM
(3)
(2) ON
(4) WHERE
(5) GROUP BY
(6) WITH {CUBE | ROLLUP}
(7) HAVING
(10) ORDER BY
left JOIN table2 ON (table1.id=table2.id)
WHERE table1.id>10 GROUP BY table1.id HAVING table1.name like '张%'
ORDER BY name
--这句是基本的,from后面是表明select * from table_name--where子句是说明查询条件where field =123--用and或者or来连接多个查询条件,like是模糊查询and field2 like '%234%'order by是用来排序的,还有group by是用来分组的,这个你得试试比较好order by field3
select * from 表名查询表的全部