首页 > 数据库技术 > 详细

一些常用的sql语句

时间:2015-12-15 00:57:21      阅读:322      评论:0      收藏:0      [点我收藏+]

1.查询表里的null值:is null 和 is not null

 select*from student where email is null       返回的该表里面邮箱为null的结果集

 select*from student where email is not null    返回的该表里面邮箱不为null的结果集

2.查询中使用的常量列

select 姓名=name,年龄=age ,‘男‘ as 性别

from student       查询中多了一列性别,该列中的所有数据都是“男”

3.top关键字

 select top 5 from student  查询该表中记录的前5条数据

  

一些常用的sql语句

原文:http://www.cnblogs.com/Allen974103107/p/5046925.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!