SELECT * FROM `表名`;
SELECT `字段名1`,`字段名2`... FROM `表名`;
SELECT `字段名1`,`字段名2`... FROM `表名` WHERE 约束条件;
SELECT `字段名1`,`字段名2`... FROM `表名` WHERE `字段名` LIKE '%或_配合关键词';
SELECT `字段名1`,`字段名2`... FROM `表名` WHERE 约束条件 ORDER BY `字段` 排序方式;
SELECT `字段名1`,`字段名2`... FROM `表名` WHERE 约束条件 ORDER BY `字段1` 排序方式,`id` 排序方式;
SELECT `字段名1`,`字段名2`... FROM `表名` WHERE 约束条件 ORDER BY `字段1` 排序方式,`id` 排序方式 LIMIT 参数1,参数2;
select c_summer,count(*) from x_lalala GROUP BY c_summer
c_summer | count(*) |
---|---|
T1000 | 19 |
T1001 | 15 |
T1002 | 12 |
T1003 | 12 |
T1004 | 14 |
T1006 | 12 |
T1007 | 12 |
SELECT * FROM information_schema.columns WHERE column_name='字段名';