常用SQL查询语句考试答案与解释.docVIP

  • 17
  • 0
  • 约9.94千字
  • 约 11页
  • 2015-10-29 发布于安徽
  • 举报
%代表任意多个字符_代表一个字符 如果我就真的要查%或者_,怎么办呢?使用escape,转义字符后面的%或_就不作为通配符了,注意前面没有转义字符的%和_仍然起通配符作用 select username from gg_user where username like %xiao_% escape ; select username from gg_user where username like %xiao%% escape ; A as B,就是给A起个别名叫B select a.* from table_1 as a就是给table_1起个别名叫a,因此前面就可以使用a.*了 比如 name as 姓名这样的话,查询出来的列就是 写 姓名 Select * from A_studentinfo where sname=张三 2、查询学生信息表,查询学生张三和”李四”的基本信息 Select * from A_studentinfo where sname=张三 or sname=李四 3、查询学生信息表,查询姓张学生的基本信息 Select * from A_studentinfo where sname like 张% 4、查询学生信息表,查询姓名中含有四字的学生的基本信息 Select * from A_studentinfo where

文档评论(0)

1亿VIP精品文档

相关文档