Skip to content

Instantly share code, notes, and snippets.

@wupher
Created October 17, 2019 03:24
Show Gist options
  • Save wupher/d7d75dd1f9fe303a2cc582382bd88a95 to your computer and use it in GitHub Desktop.
Save wupher/d7d75dd1f9fe303a2cc582382bd88a95 to your computer and use it in GitHub Desktop.
import pymysql
connection = pymysql.connect(host='localhost', port=3306, user='manager_app',
password='mgrapp123!@#', db='wjdbmgrapp',
charset='utf8')
cursor = connection.cursor()
data = []
sql = 'select times from mq2004_record where date="2019-10-15 00:00:00" order by times desc ;'
cursor.execute(sql)
rows = cursor.fetchall()
for row in rows:
data.append(row[0])
print("size of data is: %d \n" % len(data))
print("max is: %d, min is %d" % (min(data), max(data)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment