码迷,mamicode.com
首页 > 其他好文 > 详细

20141124

时间:2014-11-27 09:12:38      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:des   ar   sp   数据   2014   bs   as   nbsp   信息   

select*from category where Parent=‘011‘or‘012‘or‘013‘ select*from Category where Parent not in(‘011‘,‘012‘,‘013‘)--parent不是012,013,011的 select*from Category where Ids>500 and ids<505--id大于500,小于505的 select*from Category where Ids between 500 and 505--between  and 相当于大于等于,小于等于 select*from Category where Name like ‘%国家%‘--模糊查询,行业里边带国家两个字的. select*from Category where Name like ‘%机构‘--模糊查询,行业里边带国家两个字的. select*from Category where Name not like‘%国家%‘--not like 不带国家两个字的 select code,name from category where Ids>5 and Ids<10--子查询 select*from Category where Ids >all(--大于所有 select*from Category where Ids >any(--大于任意的一个 --排序 select *from Category order by ids asc--升序默认不写 select *from Category order by ids desc--降序一定要写 select *from Category order by Parent,Ids--先排parent后再按ids排 select *from Category order by Parent,Ids desc select *from Category order by Parent desc,Ids desc select parent from Category group by parent--对他们分组 select code from Category where Parent=‘m‘--组名 select distinct parent from Category--将一列去重显示 select top 5 *from Category--前多少条数据 select top 5*from Category order by ids--前多少条排序 select top 5*from Category where Ids>900 and Ids<950 order by

建表--学生信息表 学号,姓名,班级,性别,教师,出生日期 身高--添加20虚拟数据--查询男同学身高170以上 --查询姓王的同学信息--查询一共有几个班级--查询女同学里身高在168,170,172这三个数得信息。

              

 

20141124

标签:des   ar   sp   数据   2014   bs   as   nbsp   信息   

原文地址:http://www.cnblogs.com/577521a/p/4125552.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!