码迷,mamicode.com
首页 >  
搜索关键字:sql基础    ( 556个结果
14、SQL基础整理(存储过程)
存储过程procedure(proc)数据库—可编程性—存储过程新建存储过程:create proc firstprocasselect *from fenshugo执行存储过程:存储过程—右键—执行存储过程declare @fanhuizhi intexec @fanhuizhi = firstp...
分类:数据库   时间:2014-12-15 17:01:50    阅读次数:249
4、SQL基础整理(规范函数)
规范函数:绝对值select abs(-5)print abs(-5)表中取绝对值的方法:select code,name,abs(chinese)as yuwen from xueshengselect *from xuesheng where ABS(chinese)>90天花板、地板selec...
分类:数据库   时间:2014-12-15 16:59:11    阅读次数:253
17、SQL基础整理(事务)
事务事务==流程控制 确保流程只能成功或者失败,若出现错误会自动回到原点例:begin traninsert into student values('111','王五','男','1999-09-09','95033')if @@ERROR>0goto tranrollback--直接到tranr...
分类:数据库   时间:2014-12-15 16:58:24    阅读次数:199
11、SQL基础整理(变量)
变量定义变量:declare @hello varchar(20)赋值:set @hello = ‘你好’select(结果框显示)/print(消息框显示) @hello*三行必须同时运行declare @hello varchar(20)set @hello = '销售部'select *fro...
分类:数据库   时间:2014-12-15 16:51:09    阅读次数:227
5、SQL基础整理(字符串函数)
字符串函数ASCII返回字符串首字母的ascii编码select ASCII('name')select ASCII(name) from xueshengselect *from xuesheng where ASCII(name)>=200CHAR--将ascii代码转换成对应的字符select...
分类:数据库   时间:2014-12-15 16:49:58    阅读次数:217
1、SQL基础整理(基本查询)
分离、附加、备份、还原--去重select distinct 列名from表名--更新update fenshu set name = ‘李四’where code = 9--更改表名sp_rename 表名drop database 数据库名(删除数据库)drop table 表名Delete f...
分类:数据库   时间:2014-12-15 16:45:26    阅读次数:243
9、SQL基础整理(两表连接exists,join on,union)
exists的用法select *from haha where exists (select *from bumen where bumen.code = haha.bumen and bumen.name = '销售部' )and age>35(运行方法为逐条查询)select name,sex...
分类:数据库   时间:2014-12-15 16:43:32    阅读次数:249
2、SQL基础整理(聚合函数)
聚合函数--求平均select AVG(age) as 年龄 from xueshengselect AVG(chinese) as 语文 from xuesheng where class = 1*只能对数字类型的进行操作--求个数select COUNT(*) from xuesheng/*查询...
分类:数据库   时间:2014-12-15 16:42:50    阅读次数:239
SQL 基础1
1 use myDB; 2 insert into student values('1134110116','Tom','男',22,'上海','18272986984','上海'); 3 insert into student values('1134110117','Tom1','男',...
分类:数据库   时间:2014-12-11 20:44:39    阅读次数:242
SQL 基础--> 子查询
--========================= --SQL 基础--> 子查询 --=========================   一、子查询 子查询就是位于SELECT、UPDATE、或DELETE语句中内部的查询      二、子查询的分类 单行子查询 返回零行或一行 多行子查询 返回一行或多行 多列子查询 返回多列 相关子查询 引用外部SQL语句...
分类:数据库   时间:2014-12-11 19:13:57    阅读次数:225
556条   上一页 1 ... 48 49 50 51 52 ... 56 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!