如果要把查询所得的虚拟表存储起来,可用update
一、查询语句
select 列名
from 表名
where <查询条件表达式>
order by <排序的列名>【asc或desc】(asc为升序,desc为倒序)
示例:
select score,name
from Student
where sex='男'
order by score
ps:指查询Student表中性别为男的学生的成绩和姓名信息,且信息根据成绩升序排列。
二、查询部分行和列
select name,grade from Student
where address='浙江'
ps:指查询Student表中地址为浙江的学生的姓名年级信息
三、使用AS命令列
select number as 编号,name as 姓名,address as 地址
from Student
where address<>'山西吕梁'
ps:指查询Student表中地址不是山西吕梁的学生编号,姓名,地址信息。用as命令将列