您的位置:首页 > 数据库

Part 5 Select statement in sql server

2015-10-10 11:55 260 查看
Select specific or all columns

select * from 表名
select * from Student

select 列名,列名... from 表名
select name,age,email from Student

Distinct rows
select distinct 列名 from 表名
select distinct name from Student

Filtering with where clause(子句)
select * from Student where age>18

Wild Cards in SQL Server
Joining multiple conditions using AND and OR operators
select * from Student where age>18 and name like 'gester%' or gender=1

Sorting rows using order by
select name,email from Student
order by name

Selecting top n or top n percentage of rows
select top 10 * from Student


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: