如何知道表abc的行数
select count(*) from abc;
查询ID内容为5的行
select * from abc where id=5;
查询名字等于a的所有字段
select * from abc where name='a';
名字为b并且id大于3的内容
select * from abc where name='b' and id>3;
名字为d并且id大于3并且age大于15
select * from abc where name='d' and id>3 and age>15;
将id字段的内容去除重复
select distinct id from abc;
查询age在15-16岁的内容
select * from abc where age between 15 and 16;
根据age字段内容进行升序排列
select * from abc order by age;
根据age字段内容进行降序排列
select * from abc order by age desc;
显示查询结果的前两行
select top 2 from abc;