1. 查询
检索所有行和列
select * from table
select * from employee查询部分列
select col1,col2,col3 from table
select fname,mint from employee使用友好列标题查询(更换查询出来后的表头名称)
select col1 as 列1,col2 as 列2 from table
select fname as 名字,mint as 代号 from employee检索前n行数据
-- SQL Server
select top n * from table
select top 3 * from employee
-- MySQL
select * from table limit 0,n
select * from employee limit 0,3检索前%n行数据
指定检索条件
区间查询
筛选1列或多列不重复的数据
模糊查询
查询null数据
对查询的数据进行排序
算数表达式
函数
数据分组(group by)
多表查询
链接查询分类
嵌套查询
In
all
exists
集合查询
并运算
交运算
差运算
Last updated
Was this helpful?