码迷,mamicode.com
首页 >  
搜索关键字:where    ( 20257个结果
数据检索,top,Distinct去除重复记录
--数据检索--语法:--select 字段列表/* from 表列表 where 条件----查询所有学员信息select * from student--带条件的查询select * from Student where Sex='女'select * from Student where Se...
分类:其他好文   时间:2015-03-19 23:48:25    阅读次数:148
创建自定义存储过程
--创建自定义存储过程--语法:--if exists(select * from sysobjects where name='')-- drop proc ''--go--create proc[edure] usp_名称-- 相当于方法的():创建参数--as-- 相当于方法{}:方法体--g...
分类:其他好文   时间:2015-03-19 23:45:14    阅读次数:189
表连接Join
--表连接Join--使用子查询select StudentNo,StudentName,(select classname from Classes where ClassId=Student.ClassId) from Student--使用from多表的方式select Student.Stu...
分类:其他好文   时间:2015-03-19 23:44:31    阅读次数:217
类型转换函数:cast,convert
--类型转换函数declare @score int=(select top 1 Studentresult from Result where StudentNo=1)select '我的成绩是:'+@score --报错--一共有两种转换函数--cast(源数据 as 目标类型)--conver...
分类:其他好文   时间:2015-03-19 23:38:41    阅读次数:168
子查询
--子查询:一个查询中包含着另外一个查询,使用()包含子查询--两种子查询:--独立子查询:子查询是一个可以独立运行的完整的查询.在执行的时候先执行子查询,再执行父查询--查询 比 周治明 大的所有学员信息select BornDate from Student where StudentName=...
分类:其他好文   时间:2015-03-19 23:36:54    阅读次数:123
数据删除:delete
--数据删除:在删除的时候需要询问是否真的需要删除?同时在之后的项目中,删除往往不是真的删除,而是做删除标记--语法:--delete from 表名 where 条件delete from Teacher--删除指定的人员信息delete from Teacher where Id=26--使用d...
分类:其他好文   时间:2015-03-19 23:35:19    阅读次数:184
update 表名 set 字段=值,数据更新
--数据更新 必须考虑是否有条件,往往能够做条件首先考虑主键值和唯一键语法:update 表名 set 字段=值,字段=值 .....where 条件 not|and|or--修改年龄 update Teacher set Age=18--将所有人年龄+1 设置表达式update Teacher ....
分类:其他好文   时间:2015-03-19 23:31:22    阅读次数:478
SQL里面的视图
--视图:就是一张虚拟表,本质上就是存储了一条查询语句的代码块。它就可以像操作表一样自由的操作视图select * from vw_Test where StudentResult>70--代码创建视图语法:--go--create view vw_名称--as-- 一条查询语句--goif ex....
分类:数据库   时间:2015-03-19 23:30:22    阅读次数:229
SQL制表
use School if exists (select*from sysobjects where name='Teacher')drop table Teacher gocreate table Teacher(Id int primary key identity(1,1), --参数第一个种...
分类:数据库   时间:2015-03-19 21:54:52    阅读次数:165
android开发之onCreate( )方法详解
这里我们只关注一句话:This is where you should do all of your normal static set up。其中我们只关注normal static,normal:常规的、通常的、一般的 。static:静态的,不变的 onCreate( )方法是androi.....
分类:移动开发   时间:2015-03-19 21:45:40    阅读次数:174
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!