SQL语句基本语法.docxVIP

  • 8
  • 0
  • 约9.75千字
  • 约 17页
  • 2017-08-05 发布于河南
  • 举报
为了大家更容易理解我举出的SQL语句,本文假定已经建立了一个学生成绩管理数据库,全文均以学生成绩的管理为例来描述。   1.在查询结果中显示列名:  a.用as关键字:select name as 姓名 from students order by age  b.直接表示:select name 姓名 from students order by age  2.精确查找:  a.用in限定范围:select * from students where native in (湖南, 四川)   b.between...and:select * from students where age between 20 and 30  c.“=”:select * from students where name = 李山   d.like:select * from students where name like 李% (注意查询条件中有“%”,则说明是部分匹配,而且还有先后信息在里面,即查找以“李”开头的匹配项。所以若查询有“李”的所有对象,应该命令:%李%;若是第二个字为李,则应为_李%或_李或_李_。)  e.[]匹配检查符:select * from courses where cno like [AC]% (表示或的关系,与in(...)类似,而且[]可以表示范围,如:sele

文档评论(0)

1亿VIP精品文档

相关文档