![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mysql
tsing_9521
这个作者很懒,什么都没留下…
展开
-
mysql update +多表联结
以这三张表为例:表1 school.course;±-----±-------±-----+| c_id | c_name | t_id |±-----±-------±-----+| 01 | 语文 | 02 || 02 | 数学 | 01 || 03 | 英语 | 03 |±-----±-------±-----+3 rows in set...原创 2019-03-16 15:07:58 · 442 阅读 · 0 评论 -
将csv 文件存入mysql 报错The MySQL server is running with the --secure-file-priv option so it cannot execute
系统:windows10mysql版本:mysql 8.0step1:用create语句创建database和tablestep 2: 用下列语句将 csv 文件写入table(#表注释)load data infile ‘C:\Users\tsing\Desktop\wc.csv’ #1into table project.wc character set gb2312 #2fie...原创 2019-03-21 19:07:50 · 71026 阅读 · 18 评论 -
sql row_number 用法
row_number 语句可将select的语句按某一列排序并赋予其连续的编号,示例如下:语法:ROW_NUMBER () OVER ([ <partition_by_clause> ] <order_by_clause>) 。备注:ORDER BY 子句可确定在特定分区中为行分配唯一 ROW_NUMBER 的顺序。参数:<partition_by_claus...原创 2019-04-10 11:19:45 · 7008 阅读 · 0 评论 -
mysql和Python3 连接 pymysql 模块
安装模块:pip install pymysqlimport pymysqlconn=pymysql.connect(host='127.0.0.1',port=3306, user='root', passwd='12345qq',db='project') #建立连接 host:'127.0.0.1,不用联网也可访问数据库 port:2206 user:登录mysql的用户名,...原创 2019-04-01 11:30:00 · 258 阅读 · 0 评论 -
Python3 绘制简单的散点图
import pandas as pdimport matplotlib.pyplot as plt#设置显示的行列数pd.set_option('display.max_rows',25000)pd.set_option('display.max_columns',30)#读取数据data=pd.read_csv('wc0329.csv')#利用groupby聚合,并排序...原创 2019-04-01 14:14:35 · 1050 阅读 · 0 评论 -
mysql撤销操作,事务,回滚
对mysql数据库数据操作时经常需要撤销操作,主要用到事务和回滚用法是:1. start transaction; #开启事务2. set savepoint +回滚点名称(name); #设置回滚点名称3. balabala 数据处理balabala; #正常的数据处理4. rollback to 回滚点名称/commit; #commit 表示确认提交,将3的数据更新提交到数据...原创 2019-04-03 14:58:34 · 8544 阅读 · 0 评论 -
sql的case when then的用法
case when then else end 语句一般用于数据分类标记,比如将一组年龄数据根据年龄段分为’青年’,‘中年’,‘老年’举个栗子:#建立一张成绩单+------+------+---------+| s_id | c_id | s_score |+------+------+---------+| 01 | 01 | 80 || 01 | 02 ...原创 2019-04-10 09:46:52 · 356 阅读 · 0 评论