MySQL CookBook 学习笔记-01

1、使用指定文件,创建表并插入数据:

文件,d:\MySQL_cookbook\limbs.sql

DROP TABLE IF EXISTS limbs;
CREATE TABLE limbs
(thing   VARCHAR(20),    # what the thing islegs    INT,            # number of legs it hasarms    INT             # number of arms it has
);INSERT INTO limbs (thing,legs,arms) VALUES('human',2,2);
INSERT INTO limbs (thing,legs,arms) VALUES('insect',6,0);
INSERT INTO limbs (thing,legs,arms) VALUES('squid',0,10);
INSERT INTO limbs (thing,legs,arms) VALUES('octopus',0,8);
INSERT INTO limbs (thing,legs,arms) VALUES('fish',0,0);
INSERT INTO limbs (thing,legs,arms) VALUES('centipede',100,0);
INSERT INTO limbs (thing,legs,arms) VALUES('table',4,0);
INSERT INTO limbs (thing,legs,arms) VALUES('armchair',4,2);
INSERT INTO limbs (thing,legs,arms) VALUES('phonograph',0,1);
INSERT INTO limbs (thing,legs,arms) VALUES('tripod',3,0);
INSERT INTO limbs (thing,legs,arms) VALUES('Peg Leg Pete',1,2);
INSERT INTO limbs (thing,legs,arms) VALUES('space alien',NULL,NULL);
SQL 命令如下:

mysql> use cookbook;mysql> source d:/MySQL_cookbook/limbs.sql;
SELECT 查询验证是否成功:

mysql> select * from limbs;
+--------------+------+------+
| thing        | legs | arms |
+--------------+------+------+
| human        |    2 |    2 |
| insect       |    6 |    0 |
| squid        |    0 |   10 |
| octopus      |    0 |    8 |
| fish         |    0 |    0 |
| centipede    |  100 |    0 |
| table        |    4 |    0 |
| armchair     |    4 |    2 |
| phonograph   |    0 |    1 |
| tripod       |    3 |    0 |
| Peg Leg Pete |    1 |    2 |
| space alien  | NULL | NULL |
+--------------+------+------+


2、指定用户登录,非root:

使用MySQL Command  Line  Client,一进入就是输密码(默认为root用户),根本没有选择用户的过程

Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 38
Server version: 5.0.67-community-nt MySQL Community Edition (GPLType 'help;' or '\h' for help. Type '\c' to clear the buffer.

原来, 要能指定用户是通过 cmd 进入的

C:\>mysql -h localhost -u cbuser -pcbpass -D cookbook
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 41
Server version: 5.0.67-community-nt MySQL Community Edition (GType 'help;' or '\h' for help. Type '\c' to clear the buffer.

3、插入 SQL 类型为ENUM 和 SET 的数据(其实和操作字符串一样)

文件,d:/MySQL_cookbook/profile.sql

DROP TABLE IF EXISTS profile;
create table profile
(id		int unsigned not null auto_increment,name	char(20) not null,birth	DATE,color	enum('blue', 'red', 'green', 'brown', 'black', 'white'),foods	set('lutefisk', 'burrito', 'curry', 'eggroll', 'fadge', 'pizza'),cats	int,primary key (id)
);INSERT INTO profile (name, birth, color, foods, cats) VALUES('Fred', 		'1970-04-13', 'black', 'lutefisk,fadge,pizza',  0);
INSERT INTO profile (name, birth, color, foods, cats) VALUES('Mort', 		'1969-09-30', 'white', 'burrito,curry,eggroll', 3);
INSERT INTO profile (name, birth, color, foods, cats) VALUES('Brit', 		'1957-12-01', 'red',   'burrito,curry,pizza',   1);
INSERT INTO profile (name, birth, color, foods, cats) VALUES('Carl', 		'1973-11-02', 'red',   'eggroll,pizza',         4);
INSERT INTO profile (name, birth, color, foods, cats) VALUES('Sean', 		'1963-07-04', 'blue',  'burrito,curry',         5);
INSERT INTO profile (name, birth, color, foods, cats) VALUES('Alan', 		'1965-02-14', 'red',   'curry,fadge',           1);
INSERT INTO profile (name, birth, color, foods, cats) VALUES('Mara', 		'1968-09-17', 'green', 'lutefisk,fadge',        1);
INSERT INTO profile (name, birth, color, foods, cats) VALUES('Shepard', '1975-09-02', 'black', 'curry,pizza',        		2);
INSERT INTO profile (name, birth, color, foods, cats) VALUES('Dick', 		'1952-08-20', 'green', 'lutefisk,fadge',        0);
INSERT INTO profile (name, birth, color, foods, cats) VALUES('Tony', 		'1960-05-01', 'white', 'burrito,pizza',         0);


4、Using Prepared Statements and Placeholders in Queries

PreparedStatement s;
s = conn.prepareStatement ("SELECT id, name, cats FROM profile WHERE cats < ? AND color = ?");
s.setInt (1, 2);    
s.setString (2, "green");
s.executeQuery ( );// ... process result set here ...
s.close ( );     // close statement
      One of the benefits of prepared statements and placeholders is that parameter binding operations automatically handle escaping of characters such as quotes and backslashes that you have to worry about yourself if you put the data values into the query yourself.

     Another benefit of prepared statements is that they encourage statement reuse.

     A third benefit is that code that uses placeholder-based queries can be easier to read, although that's somewhat subjective.


5、Including Special Characters and NULL Values in Queries

(单引号[ ' ];双引号[  "  ];反斜线[  \  ];二进制数据[  可能包含:单引号,双引号,反斜线,null])

       a):Use placeholders if your API supports them. Generally, this is the preferred method, because the API itself will do all or most of the work for you of providing quotes around values as necessary, quoting or escaping special characters within the data value, and possibly interpreting a special value to map onto NULL without surrounding quotes.

PreparedStatement s;
int count;
s = conn.prepareStatement ("INSERT INTO profile (name,birth,color,foods,cats) VALUES(?,?,?,?,?)");
s.setString (1, "De'Mont");
s.setString (2, "1973-01-12");
s.setNull (3, java.sql.Types.CHAR);
s.setString (4, "eggroll");
s.setInt (5, 4);
count = s.executeUpdate ( );
s.close ( );     // close statement
       b):Use a quoting function if your API provides one for converting data values to a safe form that is suitable for use in query strings. 
//PHP3还不支持null
function sql_quote ($str)
{return (isset ($str) ? "'" . addslashes ($str) . "'" : "NULL");
}//PHP4后
function sql_quote ($str)
{return (isset ($str) ? "'" . mysql_escape_string ($str) . "'" : NULL);
}unset ($null);  # create a "null" value
$stmt = sprintf ("INSERT INTO profile (name,birth,color,foods,cats)VALUES(%s,%s,%s,%s,%s)",sql_quote ("De'Mont"),sql_quote ("1973-01-12"),sql_quote ($null),sql_quote ("eggroll"),sql_quote (4));
$result_id = mysql_query ($stmt, $conn_id);//转换后的SQL语句
INSERT INTO profile (name,birth,color,foods,cats)
VALUES('De\'Mont','1973-01-12',NULL,'eggroll','4')

6、注意:NULL的特殊性( like '%' ; not like '%' ; regexp '.*' ; not regexp '.*' 全都不能匹配)

如下表和数据:

DROP TABLE IF EXISTS taxpayer;
CREATE TABLE taxpayer
(name   VARCHAR(20),id     VARCHAR(20)    
);INSERT INTO taxpayer (name,id) VALUES('bernina', '198-48');
INSERT INTO taxpayer (name,id) VALUES('bertha',  NULL);
INSERT INTO taxpayer (name,id) VALUES('ben',     NULL);
INSERT INTO taxpayer (name,id) VALUES( NULL,     '475-83');
INSERT INTO taxpayer (name,id) VALUES( 'baidu',  '111+55');
假设我要查询,id匹配如下模式:“包含-”

mysql> select * from taxpayer where id like '%-%';
+---------+--------+
| name    | id     |
+---------+--------+
| bernina | 198-48 |
| NULL    | 475-83 |
+---------+--------+
这里id为NULL的没有匹配(正确),但是如果我用{ id not like '%-%' },按照 一般思维“要么匹配,要么不匹配”应该可以查出所有不匹配的,但 实际是id为NULL还是不再查询结果中!

mysql> select * from taxpayer where id not like '%-%';
+-------+--------+
| name  | id     |
+-------+--------+
| baidu | 111+55 |
+-------+--------+
可见对NULL要做特殊处理,{ id like '%-%' }全集的补集为{ id not like '%-%' or id is NULL }

mysql> select * from taxpayer where id not like '%-%' or id is null;
+--------+--------+
| name   | id     |
+--------+--------+
| bertha | NULL   |
| ben    | NULL   |
| baidu  | 111+55 |
+--------+--------+

正则表达式的处理结果一样,结果如下:

mysql> select * from taxpayer where id regexp '[0-9]{3}\-[0-9]{2}';
+---------+--------+
| name    | id     |
+---------+--------+
| bernina | 198-48 |
| NULL    | 475-83 |
+---------+--------+
mysql> select * from taxpayer where id not regexp '[0-9]{3}\-[0-9]{2}';
+-------+--------+
| name  | id     |
+-------+--------+
| baidu | 111+55 |
+-------+--------+
mysql> select * from taxpayer where id not regexp '[0-9]{3}\-[0-9]{2}' or id is null;
+--------+--------+
| name   | id     |
+--------+--------+
| bertha | NULL   |
| ben    | NULL   |
| baidu  | 111+55 |
+--------+--------+

7、MySQL时区,column为 TIMESTAMP 时,'1970-01-01 00:00:00' 无法插入问题。

(参考:http://www.cnblogs.com/lexus/archive/2010/11/30/1892231.html)

MySQL 时区默认是服务器的时区。
可以通过以下命令查看

mysql> show variables like '%time_zone%';
+------------------+--------+
| Variable_name    | Value  |
+------------------+--------+
| system_time_zone |        |
| time_zone        | SYSTEM |
+------------------+--------+
可以通过修改my.cnf
在 [mysqld] 之下加

default-time-zone=timezone 
来修改时区。如:
default-time-zone = '+8:00'
改了记得重启msyql喔
注意一定要在 [mysqld] 之下加 ,否则会出现 unknown variable 'default-time-zone=+8:00'

另外也可以通过命令 set time_zone = timezone
比如北京时间(GMT+0800)
set time_zone = '+8:00';
这个和php的时区设置又有点差别,比如北京时间在php中是
date_default_timezone_set('Etc/GMT-8');

美国pst时间(GMT-08:00)

set time_zone = '-8:00';

#默认时区,time_zone='+8:00'
mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2011-07-21 11:52:00 |
+---------------------+mysql> set time_zone='+0:00';mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2011-07-21 03:52:18 |
+---------------------+

如下表和数据,'1970-01-01 00:00:00' 无法插入

DROP TABLE IF EXISTS timestamp_val;
CREATE TABLE timestamp_val
(ts  TIMESTAMP
);INSERT INTO timestamp_val (ts) VALUES('1970-01-01 00:00:00');
INSERT INTO timestamp_val (ts) VALUES('1987-03-05 12:30:15');
INSERT INTO timestamp_val (ts) VALUES('1999-12-31 09:00:00');
INSERT INTO timestamp_val (ts) VALUES('2000-06-04 15:45:30');

ERROR 1292 (22007): Incorrect datetime value: '1970-01-01 00:00:00' for column 'ts' at row 1

我考虑到可能是时区的问题,就设置 time_zone='+0:00' 依然无法插入,'1970-01-01 00:00:01' 能插入!费解!!!

8、TIMEDIFF 函数有最大差值限制(838:59:59);TIMESTAMPDIFF无限制

范围以内,正确:

mysql> select timediff('2011-10-21 14:25:00','2011-10-02 10:12:22');
+-------------------------------------------------------+
| timediff('2011-10-21 14:25:00','2011-10-02 10:12:22') |
+-------------------------------------------------------+
| 460:12:38                                             |
+-------------------------------------------------------+

范围以外,错误:

mysql> select timediff('2011-10-21 14:25:00','2011-01-02 10:12:22');
+-------------------------------------------------------+
| timediff('2011-10-21 14:25:00','2011-01-02 10:12:22') |
+-------------------------------------------------------+
| 838:59:59                                             |
+-------------------------------------------------------+
mysql> select timediff('2011-10-21 14:25:00','2001-10-02 10:12:22');
+-------------------------------------------------------+
| timediff('2011-10-21 14:25:00','2001-10-02 10:12:22') |
+-------------------------------------------------------+
| 838:59:59                                             |
+-------------------------------------------------------+


TIMESTAMPDIFF 示例:

mysql> set @dt1 = '1900-01-01 00:00:00',@dt2='1910-01-01 00:00:00';mysql> select-> timestampdiff(second, @dt1, @dt2) as seconds,-> timestampdiff(minute, @dt1, @dt2) as minutes,-> timestampdiff(hour, @dt1, @dt2) as hours,-> timestampdiff(day, @dt1, @dt2) as days,-> timestampdiff(week, @dt1, @dt2) as weeks,-> timestampdiff(year, @dt1, @dt2) as years;
+-----------+---------+-------+------+-------+-------+
| seconds   | minutes | hours | days | weeks | years |
+-----------+---------+-------+------+-------+-------+
| 315532800 | 5258880 | 87648 | 3652 |   521 |    10 |
+-----------+---------+-------+------+-------+-------+

9、NULL 的特殊性!

A、排序时,asc(默认值)NULL在头,desc NULL在尾

示例--如下表和数据

DROP TABLE IF EXISTS taxpayer;
CREATE TABLE taxpayer
(name   VARCHAR(20),id     VARCHAR(20)    
);INSERT INTO taxpayer (name,id) VALUES('bernina', '198-48');
INSERT INTO taxpayer (name,id) VALUES('bertha',  NULL);
INSERT INTO taxpayer (name,id) VALUES('ben',     NULL);
INSERT INTO taxpayer (name,id) VALUES( NULL,     '475-83');
INSERT INTO taxpayer (name,id) VALUES( 'baidu',  '111+55');
操作

mysql> select * from taxpayer order by id;
+---------+--------+
| name    | id     |
+---------+--------+
| bertha  | NULL   |
| ben     | NULL   |
| baidu   | 111+55 |
| bernina | 198-48 |
| NULL    | 475-83 |
+---------+--------+
mysql> select * from taxpayer order by id desc;
+---------+--------+
| name    | id     |
+---------+--------+
| NULL    | 475-83 |
| bernina | 198-48 |
| baidu   | 111+55 |
| bertha  | NULL   |
| ben     | NULL   |
+---------+--------+
当然也可以特殊处理,将NULL永远放在尾巴处(详见:Recipe 7.14. Floating Values to the Head or Tail of the Sort Order)

mysql> select * from taxpayer order by if(id is null,1,0), id;
+---------+--------+
| name    | id     |
+---------+--------+
| baidu   | 111+55 |
| bernina | 198-48 |
| NULL    | 475-83 |
| bertha  | NULL   |
| ben     | NULL   |
+---------+--------+

B、Most aggregate functions ignore NULL values.(COUNT()、MIN()、MAX()、AVG()、SUM())

(详见:Recipe 8.8. Summaries and NULL Values)

示例--如下表和数据

DROP TABLE IF EXISTS expt;CREATE TABLE expt
(subject VARCHAR(10),test    VARCHAR(5),score INT
);INSERT INTO expt (subject,test,score) VALUES('Jane','A',47);
INSERT INTO expt (subject,test,score) VALUES('Jane','B',50);
INSERT INTO expt (subject,test,score) VALUES('Jane','C',NULL);
INSERT INTO expt (subject,test,score) VALUES('Jane','D',NULL);
INSERT INTO expt (subject,test,score) VALUES('Marvin','A',52);
INSERT INTO expt (subject,test,score) VALUES('Marvin','B',45);
INSERT INTO expt (subject,test,score) VALUES('Marvin','C',53);
INSERT INTO expt (subject,test,score) VALUES('Marvin','D',NULL);
操作

mysql> select subject,-> count(score) as n,-> sum(score) as total,-> avg(score) as average,-> min(score) as lowest,-> max(score) as hightest-> from expt group by subject;
+---------+---+-------+---------+--------+----------+
| subject | n | total | average | lowest | hightest |
+---------+---+-------+---------+--------+----------+
| Jane    | 2 |    97 | 48.5000 |     47 |       50 |
| Marvin  | 3 |   150 | 50.0000 |     45 |       53 |
+---------+---+-------+---------+--------+----------+
实际处理的数据只有2+3=5条!NULL都被忽略了!

如果计算的集合为 empty 或集合内的值都为 NULL ,则计算后的结果也为 NULL 。

mysql> select subject,-> count(score) as n,-> sum(score) as total,-> avg(score) as average,-> min(score) as lowest,-> max(score) as hightest-> from expt where score is null group by subject;
+---------+---+-------+---------+--------+----------+
| subject | n | total | average | lowest | hightest |
+---------+---+-------+---------+--------+----------+
| Jane    | 0 |  NULL |    NULL |   NULL |     NULL |
| Marvin  | 0 |  NULL |    NULL |   NULL |     NULL |
+---------+---+-------+---------+--------+----------+

10、group by 后排序 , 直接在后边加 order by xxx 即可。

mysql> select-> monthname(statehood) as month,-> dayofmonth(statehood) as day,-> count(*) as count-> from states group by month , day having count>1;
+----------+------+-------+
| month    | day  | count |
+----------+------+-------+
| February |   14 |     2 |
| June     |    1 |     2 |
| March    |    1 |     2 |
| May      |   29 |     2 |
| November |    2 |     2 |
+----------+------+-------+
mysql> select-> monthname(statehood) as month,-> dayofmonth(statehood) as day,-> count(*) as count-> from states group by month , day having count>1 order by day;
+----------+------+-------+
| month    | day  | count |
+----------+------+-------+
| June     |    1 |     2 |
| March    |    1 |     2 |
| November |    2 |     2 |
| February |   14 |     2 |
| May      |   29 |     2 |
+----------+------+-------+








































本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/498187.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Cocos Creator棋牌开发-部署经验总结

Cocos Creator棋牌开发-部署经验总结1.服务器系统部署2.安装环境3.开放端口3.1接下来在centos中也开放端口1.服务器系统部署 服务器系统&#xff1a;Centos 7 数据库&#xff1a;mariadb 服务端:NodeJS 2.安装环境 1.安装宝塔 》安装 PM2.5管理器 》安装mariadb 2.配置好Nod…

人工智能正在激活互联网类脑系统,2018年,云脑将成为新热点

作者&#xff1a;未来智能实验室 一&#xff0c;AI与互联网的结合 从科学史可以看到这样一个规律&#xff0c;每一次人类社会的重大技术变革都会导致新领域的科学革命&#xff0c;互联网革命对于人类的影响已经远远超过了大工业革命。与工业革命增强人类的力量和视野不同&…

MYSQL 连接数据库命令收藏

一、MySQL 连接本地数据库&#xff0c;用户名为“root”&#xff0c;密码“root”&#xff08;注意&#xff1a;“-p”和“root” 之间不能有空格&#xff09;C:\>mysql -h localhost -u root -proot二、MySQL 连接远程数据库&#xff08;192.168.0.201&#xff09;&#xf…

CoCos Creator打包各类问题总结

CoCos Creator打包各类问题总结如果你的打包APK 出现 ‘黑屏\找不到Mould看这里&#xff01;’JAVA JDK环境变量与构建 毫无关系&#xff01;&#xff01;&#xff01;1. SDK NDK 配置2. 热更新问题3. 打包配置如果你的打包APK 出现 ‘黑屏\找不到Mould看这里&#xff01;’ J…

AI 知名企业“云从科技”今宣布完成 B 轮融资,总计获 25 亿元资金支持

来源&#xff1a; DeepTech深科技 概要&#xff1a;近日&#xff0c;中国人工智能国家队云从科技正式完成 B 轮 5 亿元人民币融资&#xff0c;加上此前广州市政府对云从科技的 20 亿政府资金支持&#xff0c;此次总计获得 25 亿元发展资金。 近日&#xff0c;中国人工智能国家队…

Cocos Creator -构建打包 所有版本测试

Cocos Creator -构建打包 所有版本测试 目前在打包APK时&#xff0c;出现了种种问题&#xff0c;都是因为打包环境操作&#xff0c;所以为了解决所有同行的同惑 ***大菠萝***做了一系列测评 SDK26SDK27SDK28SDK29SDK30JDK18√√√√JDK19√√√JDK20√√√√√JDK21√JDK21 如…

Andrej Karpathy发文谈神经网络:这不仅仅是分类器,这是一种新的软件开发思想

作者&#xff1a; 晓凡 概要&#xff1a;有越来越多的传统编程语言&#xff08;C、C、Java&#xff09;等程序员开始学习机器学习/深度学习&#xff0c;而对机器学习/深度学习的研究人员来说&#xff0c;编程也是必备技巧。 有越来越多的传统编程语言&#xff08;C、C、Java&am…

PineApple_Ninja.js

PineApple_Ninja.js 1.本章内容 2.理解函数的重要性 3.定义函数的方式 4.参数赋值 JavaScript中最关键的函数是&#xff1a;第一类对象&#xff08;first-class objects&#xff09; 函数与对象共同存在&#xff0c;函数也可以被视为其他任意类型的JS对象。 函数和普通数据类…

Java国际化资源绑定-----示例

mess.properties文件&#xff1a;helloHello World! msgHello,{0}!Today is {1}.mess_en_US.propertieshelloHello World! msgHello,{0}!Today is {1}. mess_zh_CN.properties&#xff08;Properties Editor插件&#xff09;hello您好&#xff01; msg你好&#xff0c;{0}&…

微软为什么要公开AI系统测试数据集和度量指标?

来源&#xff1a; 微软研究院AI头条 概要&#xff1a;微软研究院Maluuba团队的研究员Samira Ebrahimi Kahou等人在研究如何利用人工智能理解柱线图和饼图中所包含的信息这一问题时遇到了一个难题&#xff1a;没有现成的数据集可以用来测试他们的假设。 微软研究院Maluuba团队的…

SHA384-算法解密

今天无意发现一款网页你懂得游戏 于是出于好奇就去玩了一会&#xff0c;看着小姐姐发卡。 于是打开抓包软件。 这里推荐大家准备好 1.抓包软件 2纸和笔 用来在10秒内完成计算 先来了解一下 sha384算法&#xff0c;很难破解 但是巧了&#xff0c;我就这么巧&#xff01; 看了20多…

JS写纸牌发牌和动画(详细解剖)

先看演示 游戏构建准备 1.准备52张纸牌 2.一张桌布 3.编辑工具为 Visual Code 技术概要 1.对象操作 2.数据操作 3.JS animation动画 4.全局变量 function desen_x(){let that this;var desen["h_1","h_2","h_3","h_4","h_5&…

科技产品下一个重大突破将来自芯片堆叠技术

来源&#xff1a;网易科技 概要&#xff1a;作为几乎所有日常电子产品最基础的一个组件&#xff0c;微芯片正出现一种很有意思的现象。 作为几乎所有日常电子产品最基础的一个组件&#xff0c;微芯片正出现一种很有意思的现象。通常又薄又平的微芯片&#xff0c;如今却堆叠得像…

Inside Class Loaders

原文&#xff1a;http://onjava.com/pub/a/onjava/2003/11/12/classloader.htmlIn this part, I want to lay the groundwork on which we can start a discussion about dynamic and modular software systems. Class loaders may seem to be a dry topic, but I think it is …

Cocos creator -引擎解构

Cocos creator -引擎结构 在长期的开发中&#xff0c;发现cc对大型的手游加载项目的速度很慢&#xff0c;于是我产生了一种想法&#xff0c;想把 cocos creator移植在Linux上做开发&#xff0c;编译时在Windows。但是这样太麻烦了。索性&#xff0c;研究一下它的构造&#xff…

计算机视觉简介:历史、现状和发展趋势

来源&#xff1a;专知 概要&#xff1a;正像其它学科一样&#xff0c;一个大量人员研究了多年的学科&#xff0c;却很难给出一个严格的定义&#xff0c;模式识别如此&#xff0c;目前火热的人工智能如此&#xff0c;计算机视觉亦如此。 【导读】本文由中国科学院自动化研究所模…

MySQL Cookbook 学习笔记-02

1、分组后查找最大或最小值 2、根据“日期-时间”分组 3、“分组计算” 和 “全局计算” 同时存在查询中 4、删除一行数据&#xff0c;sequence 列会重新生成吗&#xff1f; 5、sequence 列指定值插入&#xff0c;不是我认为的不能指定值哦&#xff01; 6、删除最大 sequence 行…

IIS-HTTPS(TSL)强制开启的方法和解决过时的安全问题

IIS-HTTPS(TSL)强制开启的方法和解决过时的安全问题 系统为:Windows server 2008R2 工具为:IIS6 数据库为: Windows Sql server 2014 证书为:腾讯云颁发的AC证书 首先你需要这几个工具 IISCrypto | 检测和为你配置最安全的 策略环境 手写reg注册表 | 来关闭本地的事件 Windo…

AI在医疗行业的最新进展

来源&#xff1a; Future智能 概要&#xff1a;随着人工智能、大数据等相关应用与理念的不断传播&#xff0c;越来越多曾经深入人心的观念被彻底撼动&#xff0c;当然&#xff0c;医疗行业也不例外。 随着人工智能、大数据等相关应用与理念的不断传播&#xff0c;越来越多曾经深…

用jar 命令打包war包

假定有一个Web应用&#xff1a;C:\myHomemyHome/WEB-INF/……myHome/files/……myHome/image/……myHome/src/……myHome/index.jsp在命令行窗口下执行如下命令&#xff1a;C:\>cd myHomeC:\myHome\>jar cvf myhome.war */ .解释&#xff1a;jar cvf [A》 war包…