1.封装转储存储过程

CREATE  PROCEDURE `add_resident_portrait`()

BEGIN

TRUNCATE TABLE resident_portrait;

INSERT INTO resident_portrait (

vehicleNumber,

parkid,

vehicleType,

vehicleBrand,

vehiclePhoto,

vehicleColor,

vehicleResidentFlag,

estate_address,

building_code,

unit_code,

floor,

areasize,

house_number,

estate_type,

delivery_time,

checkin_time,

rent_flag,

volResource,

volIntro,

checkStatus,

volunteerType,

signTime,

nation,

marr_status,

edu_status,

belief,

height,

weight,

resaddr,

restype,

healths,

volunid,

mail,

wechat,

huimg_url,

blood,

resimg_url,

workplace,

profession,

address,

phone_num,

mobnum,

political,

photo_url,

street,

cu,

area,

pro,

build,

NAME,

sex,

birthday,

idcard,

fatherid,

motherid

) SELECT

#车牌号

vehicleinfo.vehicleNumber,

#停车场编号

vehicleinfo.parkid,

#车辆类型

vehicleinfo.vehicleType,

#车辆品牌

vehicleinfo.vehicleBrand,

#车辆照片

vehicleinfo.vehiclePhoto,

#车辆颜色

vehicleinfo.vehicleColor,

#车辆业主属性

vehicleinfo.vehicleResidentFlag,

#房产地址

pr_estate_info.estate_address,

#楼号

pr_estate_info.building_code,

#单元号

pr_estate_info.unit_code,

#楼层

pr_estate_info.floor,

#面积

pr_estate_info.area,

#门牌号

pr_estate_info.house_number,

#房产类型

pr_estate_info.estate_type,

#交房时间

pr_estate_info.delivery_time,

#入住时间

pr_estate_info.checkin_time,

#是否出租

pr_estate_info.rent_flag,

#志愿者资质

volunteerinfo.volResource,

#志愿者可提供服务简介

volunteerinfo.volIntro,

#志愿者审核状态

volunteerinfo.checkStatus,

#志愿者类型

volunteerinfo.volunteerType,

#志愿者注册时间

volunteerinfo.signTime,

#民族

cu_resinfo.nation,

#婚姻状态

cu_resinfo.marr_status,

#教育情况

cu_resinfo.edu_status,

#宗教信仰

cu_resinfo.belief,

#身高

cu_resinfo.height,

#体重

cu_resinfo.weight,

#户籍地址

cu_resinfo.resaddr,

#户籍类型

cu_resinfo.restype,

#健康情况

cu_resinfo.healths,

#志愿者id

cu_resinfo.volunid,

#邮箱

cu_resinfo.mail,

#微信

cu_resinfo.wechat,

#房产证照片地址

cu_resinfo.huimg_url,

#血型

cu_resinfo.blood,

#户口本照片地址

cu_resinfo.resimg_url,

#工作单位

cu_resinfo.workplace,

#职业

cu_resinfo.profession,

#地址

cu_resinfo.address,

#固定电话

cu_resinfo.phone_num,

#手机

cu_resinfo.mobnum,

#政治面貌

cu_resinfo.political,

#照片地址

cu_resinfo.photo_url,

#所属街道

cu_resinfo.street,

#所属社区

cu_resinfo.cu,

#所属小区

cu_resinfo.area,

#所属物业

cu_resinfo.pro,

#所属楼宇

cu_resinfo.build,

#姓名

cu_resinfo. NAME,

#性别

cu_resinfo.sex,

#生日

cu_resinfo.birthday,

#身份证号

cu_resinfo.idcard,

#父亲id

cu_resinfo.fatherid,

#母亲id

cu_resinfo.motherid

FROM

cu_resinfo,

pr_estate_info,

vehicleinfo,

volunteerinfo

WHERE

cu_resinfo.id = vehicleinfo.staffid

AND cu_resinfo.id = pr_estate_info.staffid

AND cu_resinfo.volunid = volunteerinfo.id;

END

2.定时执行任务

CREATE EVENT

dump_resident_portrait

ON SCHEDULE EVERY 7 DAY

STARTS '2018-09-02 00:00:00' DO

CALL add_resident_portrait;

mysql将大表定时转储_mysql数据库数据定时封装转储相关推荐

  1. mysql数据库自动转储_mysql数据库数据定时封装转储

    1.封装转储存储过程 CREATE  PROCEDURE `add_resident_portrait`() BEGIN TRUNCATE TABLE resident_portrait; INSER ...

  2. mysql删除emp表的语句_MySQL删除数据表(DORP TABLE语句)

    在MySQL数据库中,对于不再需要的数据表,我们可以将其从数据库中删除. 在删除表的同时,表的结构和表中所有的数据都会被删除,因此在删除数据表之前最好先备份,以免造成无法挽回的损失. 下面我们来了解一 ...

  3. mysql查询单表的销售额_MYsql数据库单表百万数据量查询

    最近总在意自己的网页刷新数据的速度,mysql5.7和mysql8.0单表数据库导入百万甚至千万数据的时候,会不会卡死,会不会慢? 因此编写测试用例,通过Navicat Premium来查询单表的时间 ...

  4. mysql表误删回复_mysql数据库数据删除怎么恢复

    不小心把数据库删掉了,想要恢复数据,除了备份以外,还有以下方法. 在mysql有时执行了错误的update或者delete时导致大量数据错误恢复的办法.执行时没有开启事务,也没有对数据进行.这时就需要 ...

  5. mysql truncate 大表_MySQL删除大表时潜在的问题(drop table,truncate table)

    case1,删除大表时,因为清理自适应hash索引占用的内容导致的MySQL服务挂起 case2,大表的随意Drop或者truncate导致MySQL服务的挂起 按照本文中的结论就是 MySQL5.6 ...

  6. 关于mysql一张表到底能存多少数据?

    前言 程序员平时和mysql打交道一定不少,可以说每天都有接触到,但是mysql一张表到底能存多少数据呢?计算根据是什么呢?接下来咱们逐一探讨 知识准备 数据页 在操作系统中,我们知道为了跟磁盘交互, ...

  7. mysql的联表查询和去重复数据

    mysql的联表查询和去重复数据 /* SQLyog Ultimate v10.00 Beta1 MySQL - 5.7.17-log : Database - pusmtnew ********** ...

  8. MySQL查询一个表的前25%的数据

    MySQL查询一个表的前25%的数据,SQL如下: # qianfeng SELECT g.* FROM (SELECT @rownum:=0) r join tb_shopping_car g wh ...

  9. 【Spark调优】大表join大表,少数key导致数据倾斜解决方案

    [Spark调优]大表join大表,少数key导致数据倾斜解决方案 参考文章: (1)[Spark调优]大表join大表,少数key导致数据倾斜解决方案 (2)https://www.cnblogs. ...

最新文章

  1. spring security实现登录验证以及根据用户身份跳转不同页面
  2. date时区 es logstash_elastic date时区问题解决办法
  3. Golang实现Server和Client的TCP通讯
  4. solr mysql 速度_提高solr的搜索速度
  5. Echarts数据可视化event图表事件的相关操作,开发全解+完美注释
  6. 什么技术才值得你长期投入? | 凌云时刻
  7. python 小说分析_Python文章相关性分析---金庸武侠小说分析
  8. coverity代码检测工具介绍_Coverity功能介绍
  9. php theexcerpt,WordPress获取文章摘要函数the_excerpt详解
  10. 分享一个去广告的浏览器插件
  11. 洛谷P1359租用游艇
  12. JAVA Applet——绘制心形曲线
  13. 中国农业会计杂志中国农业会计杂志社中国农业会计编辑部2022年第12期目录
  14. HTTP 204,304状态码
  15. python爬虫实现股票数据存储_Python爬虫抓取东方财富网股票数据并实现MySQL数据库存储!...
  16. 存储圈装逼必上TOP 10网站
  17. 201671010412 郭佳 实验三 作业互评与改进
  18. VBA 金额转英文大写 数字转英文 EXCEL
  19. Python人脸识别智能考勤系统 (供源码,附报告)(可答疑,可调试)
  20. 动软代码生成器 第一次使用出现附加数据库错误是否添加写入权限

热门文章

  1. 云计算十年 腾讯新一代企业安全助力云化之路
  2. 运维总监聂鑫:腾讯海量监控体系经验分享
  3. VirtualBox下安装Ubuntu Server 16.04
  4. rtmp 常用字段含义
  5. 互斥锁属性PTHREAD_MUTEX_RECURSIVE
  6. android jni通过cmake使用第三方静态库和动态库
  7. 浅谈疫情下的就业形势
  8. mapreduce,map后面跟map是什么操作???
  9. Arch Linux 没有声音:Intel sound card snd_hda_intel not working 解决方法
  10. leetcode 227. Basic Calculator II | 227. 基本计算器 II(中缀表达式求值)