上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 66 下一页

2015年4月12日

MySQL 关闭子表的外键约束检察

摘要: 准备: 定义一个教师表、一个学生表;在学生表中引用教师表IDcreate table teachers(teacherID int not null auto_increment primary key,teacherName varchar(8));create table students(s... 阅读全文

posted @ 2015-04-12 17:25 蒋乐兴的技术随笔 阅读(1518) 评论(0) 推荐(0)

SQL Server Mysql primary key可更新性分析

摘要: SQL Server: 一般来说SQL Server 中表的主键是支持更新操作的、但是如果这个主键是由identity(1,1)这类的方式生成的话它是不可更新的。Mysql : Mysql 中表的主键是支持更新操作的不管它有没有auto_increment 这一特性。 阅读全文

posted @ 2015-04-12 16:46 蒋乐兴的技术随笔 阅读(287) 评论(0) 推荐(0)

2015年4月8日

SQL Server 排名函数实现

摘要: 在SQL Server 中有四大排名函数分别是:1、row_number()2、ntile()3、rank()4、dense_rank()-------------------------------------------------------------------------为了方便演示我们... 阅读全文

posted @ 2015-04-08 17:44 蒋乐兴的技术随笔 阅读(417) 评论(0) 推荐(0)

2015年4月6日

MySQL select

摘要: SQL_CACHE: 期望查询从Query_Cache 中取值、而不是去表中查找。当然如果查询缓存中没有的话它就要从表中找了。SQL_NO_CACHE: 不允许查询从缓存中取值、而是直接从表中查找。SQL_BUFFER_RESULT: 把查询结果缓存起来、下次好用。 阅读全文

posted @ 2015-04-06 23:14 蒋乐兴的技术随笔 阅读(119) 评论(0) 推荐(0)

2015年4月4日

MySQL 数据显示宽度

摘要: 例子: 把int 的显示宽度设置为 3 create table t(x int(3) zerofill); insert into t(x) values(1); select x from t; 从结果中可以看出 x 的输出被格式化成了三位!但是如果我们插入一个四位数会怎么样呢? ... 阅读全文

posted @ 2015-04-04 11:03 蒋乐兴的技术随笔 阅读(1354) 评论(0) 推荐(0)

MySQL zerofill 的用法

摘要: creata table t(x int(6) zerofill,y int); insert into t(x,y) values(1,1); select x,y from t; 阅读全文

posted @ 2015-04-04 10:54 蒋乐兴的技术随笔 阅读(720) 评论(0) 推荐(0)

2015年4月3日

MySQL Select 优化

摘要: 准备: create table t(x int primary key,y int unique,z int); insert into t(x,y,z) values(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),(6,6,6),(7,7,7),(8,8,8)... 阅读全文

posted @ 2015-04-03 09:05 蒋乐兴的技术随笔 阅读(798) 评论(0) 推荐(0)

2015年4月2日

SQL Server 多表删除

摘要: 第一步: 建表 create table t1(x int, y int); create table t2(x int, y int); go insert into t1(x,y) values(1,2),(2,3),(3,4),(4,5),(5,6); insert into t2... 阅读全文

posted @ 2015-04-02 23:56 蒋乐兴的技术随笔 阅读(8118) 评论(0) 推荐(0)

SQL Server Mysql 对null值理解的不同

摘要: 在说到对null值的理解主要是用unique来体现的。也是说null在unique约束看来是一个值还是多个值的问题。还是开始实验吧。MYSQL create table t(x int ,constraint ix_unique_x unique index (x)); insert into ... 阅读全文

posted @ 2015-04-02 15:49 蒋乐兴的技术随笔 阅读(265) 评论(0) 推荐(0)

SQL Server 数据库备份到域中别的机器上

摘要: backup database dbName to disk ='\\SV2\D\dbbackup\dbName.bak' with init,compression; 阅读全文

posted @ 2015-04-02 14:15 蒋乐兴的技术随笔 阅读(190) 评论(0) 推荐(0)

上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 66 下一页

导航