今天有点尴尬,欸~先写个python吧
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import pymysql
import datetime
import time
import re,string
#替换为**
……………………
def update_time_exe():
zone_list = find_update_time_rows()
db = pymysql.connect(host=host, user=mysql_user_name, password=password, database="test")
sql = "update test.station set station_group_code = (%s) WHERE station_code = (%s);"
cursor = db.cursor()
container_code_list = []
for row in zone_list:
if row[0] !='' :
container_code_list.append((row[0],row[1]))
cursor.executemany(sql, container_code_list)
db.commit()
db.close()
return
def find_update_time_rows():
sql = "SELECT ws.station_group_code as station_group_code ,s.station_code as station_code from ((SELECT station_code from test.station WHERE station_code ) as s LEFT JOIN (SELECT station_code,station_