最基本的SQL查询语句:
select (table fields list)表的字段列表
from (table names list)表名称列表
where (row constraints specification)行约束规范
group by (grouping specification)分组规范
having (grouping selection specification)分组选择规范
order by (order rules specification) 秩序规则的规范
select *(star 星号:表的所有列 )实际工作中尽量少用 * (因为所有数据量太大)
select (table fields list)表的字段列表
from (table names list)表名称列表
where (row constraints specification)行约束规范
group by (grouping specification)分组规范
having (grouping selection specification)分组选择规范
order by (order rules specification) 秩序规则的规范
select *(star 星号:表的所有列 )实际工作中尽量少用 * (因为所有数据量太大)
select (所需要查询的类型如:ID,name,ProductNumber,Color,Size 等等) from (所要查询的表)
select (要查询的类:Listprice)from (要查询的表) order by (指定某一类项:Listprice ) desc desc ==descending order;倒序排列 asc ==ascending order ;正序排列
select (要查询的类:name,listprice) from (要查询的表) order by (指定类 listprice) desc (指定类 name)