import pymssql
conn = pymssql.connect(host='localhost', user='***', password='***', database='earth_pressure')
cur = conn.cursor()
#ringNumber pressureAverage forwardVelocity conveyorSpeed为列名,earth_pressure_100_250为标名,where后面为筛选条件
sql = 'select ringNumber,pressureAverage,forwardVelocity,conveyorSpeed from earth_pressure_100_250 where ringNumber>='+str(currentRingNumber-20)+' and ringNumber <='+str(currentRingNumber)
dataDf = pd.read_sql(sql, conn)
conn.commit()
cur.close()
conn.close()