随笔分类 -  Mysql

摘要:https://www.cnblogs.com/codeAB/p/6387148.html 阅读全文
posted @ 2018-07-05 20:01 余***龙 阅读(290) 评论(0) 推荐(0) 编辑
摘要:SET FOREIGN_KEY_CHECKS=0; -- Table structure for guestbook-- DROP TABLE IF EXISTS `guestbook`;CREATE TABLE `guestbook` (`id` int(10) unsigned NOT NULL 阅读全文
posted @ 2018-03-03 21:01 余***龙 阅读(2432) 评论(0) 推荐(0) 编辑
摘要:http://www.jb51.net/article/24508.htm 阅读全文
posted @ 2017-10-12 10:33 余***龙 阅读(176) 评论(0) 推荐(0) 编辑
摘要:http://www.cnblogs.com/sbaicl/articles/3132010.html 阅读全文
posted @ 2017-10-12 10:28 余***龙 阅读(119) 评论(0) 推荐(0) 编辑
摘要:本来一直用着centos6.8感觉良好,无奈Python是2.6的,升级了2.7之后全是坑,然后受不了改为centos7.2,里面的python直接是2.7免得折腾 原文链接 阅读全文
posted @ 2017-06-21 14:53 余***龙 阅读(123) 评论(0) 推荐(0) 编辑
摘要:http://linux.it.net.cn/CentOS/course/2015/1208/18611.html 阅读全文
posted @ 2017-06-05 17:12 余***龙 阅读(335) 评论(0) 推荐(0) 编辑
摘要:1.先安装apache, yum install httpd 2.安装MySQL rpm -qa | grep mysql // 这个命令就会查看该操作系统上是否已经安装了mysql数据库.安装前,如果原来已经装了mysql,现将其清除 或者: rpm -e mysql // 普通删除模式 rpm 阅读全文
posted @ 2017-04-20 22:28 余***龙 阅读(171) 评论(0) 推荐(0) 编辑
摘要:http://www.centoscn.com/mysql/2014/1211/4290.html 阅读全文
posted @ 2017-04-20 20:53 余***龙 阅读(113) 评论(0) 推荐(0) 编辑
摘要:原文链接 阅读全文
posted @ 2017-02-23 20:29 余***龙 阅读(103) 评论(0) 推荐(0) 编辑
摘要:在创建存储过程前把结束符定义为 delimiter // 然后再创建就不会报错 阅读全文
posted @ 2017-01-06 14:43 余***龙 阅读(505) 评论(0) 推荐(0) 编辑
摘要:http://www.jb51.net/article/31200.htm 阅读全文
posted @ 2016-12-22 00:13 余***龙 阅读(1024) 评论(0) 推荐(0) 编辑
摘要:http://blog.sina.com.cn/s/blog_4d8730df01014jiy.html 阅读全文
posted @ 2016-12-18 19:54 余***龙 阅读(154) 评论(0) 推荐(0) 编辑
摘要:翻阅mysql手册时,看到有个示例使用了bit_or方法来去除重复的数据,一开始没看明白,后来看明白之后感觉非常巧妙。示例要实现的功能就是计算每月有几天有访问,先把示例摘录在这里。 1 2 3 4 5 6 7 -- 创建表 CREATE TABLE t1 (year YEAR(4), month I 阅读全文
posted @ 2016-12-05 18:56 余***龙 阅读(980) 评论(0) 推荐(0) 编辑
摘要:MySQL默认情况下是否区分大小写,使用show Variables like '%table_names'查看lower_case_table_names的值,0代表区分,1代表不区分。 阅读全文
posted @ 2016-12-04 11:33 余***龙 阅读(8771) 评论(0) 推荐(0) 编辑
摘要:表a 表b a1 a2 b1 b2 a01 张三 a02 数学 a02 李四 a03 语文 a03 王五 a04 英语 1 select a.a2,b.b2 from a left join b on a.a1 = b.b1 张三 李四 数学 王五 语文 1 select a.a2,b.b2 fro 阅读全文
posted @ 2016-11-08 11:58 余***龙 阅读(608) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-11-08 11:55 余***龙 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-11-08 11:14 余***龙 阅读(196) 评论(0) 推荐(0) 编辑
摘要:今天早上在做数据库的练习, 我是这样写的: 得出是: 后来才知道是: 结果是: 后来我意识到区别,于是查资料得到: 数据库中的count,是用来统计你查询出来的记录数,比如学生表中有十条记录:select count(*) from 学生表;这样查询出来的count就是10 了。sum() 是求和的 阅读全文
posted @ 2016-11-08 10:59 余***龙 阅读(8205) 评论(0) 推荐(0) 编辑
摘要:1。为books表增加一个字段,字段名称b_hit,数据类型为int,宽度为5,默认值为0,不能为空。2.为sells表增加一个外键,外键名称为fk_member_no,关联到members表中的m_no字段。 alter table books add column b_hit int(5) de 阅读全文
posted @ 2016-11-07 19:57 余***龙 阅读(488) 评论(0) 推荐(0) 编辑
摘要:alter table tablename add id int(10) not null;//不自增,自增的话还要加auto_increment=1;Alter table tb add primary key(id); 阅读全文
posted @ 2016-11-07 19:43 余***龙 阅读(715) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示