–查询tsID降序排列的前五个学生
select top 5 * from TblStudent order by tsID desc
desc是降序排列,如果不写,则默认为升序,asc
–查询结果合并为一列
select top 5
tsAddress+’ ‘+tsName as studentName
from TblStudent order by tsID desc
–按百分比求,向上取整
select top 10 percent * from TblStudent order by tsID desc
–distinct去除重复,
select distinct
tsName,tsAddress,tsClassID
from TblStudent
如果查询结果的所有列都重复,则去除重复,只是显示的结果去除重复,不影响数据库的内容