Created
October 17, 2019 03:24
-
-
Save wupher/d7d75dd1f9fe303a2cc582382bd88a95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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