233 1 分钟

场景:两张表有一个共有的字段关联,比如说 A 表,B 表都有一个关联的 id,现在想根据 id,将 A 表的 name 字段更新到 B 表的 name 字段上 SQL: update tab1set val = (select val from tab2 where tab1.id = tab2.id)where exists(select 1 from tab2 where tab1.id = tab2.id);参考: https://blog.csdn.net/aiynmimi/article/details/53993803
4k 4 分钟

使用第三方组件 colResizable-1.6.min.js (官网:http://www.bacubacu.com/colresizable/) <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <script...
803 1 分钟

插入 oracle 时,如果某个列存在唯一约束,同时批量插入时数据重复,会报 error,此时将 error 的过滤掉,最后 commit def insert_one_by_one(): from sqlalchemy import create_engine engine = create_engine("oracle://user:pass@xx.xx.xx.xx:xxxx/?service_name=xxx.xxx.xxx", echo=True) user_list = [{'username':...
1.2k 1 分钟

def batch_insert_test(): from sqlalchemy import create_engine, Table, Column, func, String, MetaData import pandas as pd import logging engine = create_engine("oracle://user:pass@x.x.x.x:xxxx/?service_name=xxx.xxx.xxx", echo=True) # Temp list user_list = [{'mingzi':...
651 1 分钟

common method function getAjaxPromise (url, params){ return new Promise(function(resolve, reject){ $.ajax({ url: url, type: 'post', async: true, contentType: "application/json", data: JSON.stringify(params), success: function(data){...
473 1 分钟

Sub CheckDiff() Dim r%, i% Dim arr, brr Dim d As Object Set d = CreateObject("scripting.dictionary") With Worksheets("sheetName") r = .Cells(.Rows.Count, 1).End(xlUp).Row arr = .Range("a2:a" & r) For i = 1 To UBound(arr) d(arr(i, 1)) = "" Next r =...
2.4k 2 分钟

原因:使用 dateutil 的 rrule 时,计算速度比较慢 def axx(): from dateutil import rrule received_time = datetime.datetime.strptime('2019-04-21 23:00:00', '%Y-%m-%d %H:%M:%S') complete_time = datetime.datetime.strptime('2019-04-22 01:00:00', '%Y-%m-%d %H:%M:%S') workdays = [x for x in...
894 1 分钟

代码 def exclude_weekend_time(): from dateutil import rrule start_date = datetime.datetime.strptime('2019-04-19 13:21:46', '%Y-%m-%d %H:%M:%S') end_date = datetime.datetime.strptime('2019-04-22 13:21:46', '%Y-%m-%d %H:%M:%S') days_off = 5, 6 workdays = [x for x in...
516 1 分钟

import paramiko def get_server_log(): hostname = "" port = 22 username = "" password = "" client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(hostname, port, username, password, compress=True) remote_command =...
1.3k 1 分钟

代码 import paramiko def get_server_log(): hostname = "" port = 22 username = "" password = "" client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(hostname, port, username, password, compress=True) sftp_client =...