数据库
记录一些SQL和相关脚本,配置和调优方案
Joy_917
一个被修电脑耽误的民谣厨子
展开
-
主从数据库单向同步脚本
如题,老样子直接上代码: #!/usr/bin/env python # -*- coding:utf-8 -*- # @Modify : 2018/8/10 11:38 # @Author : Joy # @Ide : PyCharm Community Edition ''' 同步数据库脚本 ''' import pymysql import datetime #...原创 2018-08-13 14:16:59 · 653 阅读 · 0 评论 -
Oracle语句积累
以别的表中字段(包含数据)为基础创建新表:create table t2 as select t1.a,t1.b from t1;用一张表中的数据更新另一张表的数据:update t1 set t1.a = (select t2.a from t2 where t1.b = t2.b);使用转义字符查询, ESCAPE 将任意符号设为转义字符,其后紧邻的 '_' 不是模糊匹配:select * f...原创 2018-04-18 10:06:38 · 226 阅读 · 3 评论 -
SQLite-Python中如何返回、查询中文字段
博主在这个问题上卡了挺久的,贴出来解决方法帮助需要的朋友,直接上代码(测试环境:win10+Python2.7):# coding=utf-8 import sqlite3 with sqlite3.connect(":memory:") as conn: try: init_sql = " create table test (id integer primary k...原创 2018-02-28 13:43:33 · 2775 阅读 · 0 评论