使用python 27仅检索SQLITE中一行的最后一个值
我使用这段代码从sqlite行获取所有数据,但我只想检索最后30个条目使用python 27仅检索SQLITE中一行的最后一个值,python,sqlite,Python,Sqlite,我使用这段代码从sqlite行获取所有数据,但我只想检索最后30个条目 import sqlite3 from matplotlib import pyplot fig = pyplot.figure() con = sqlite3.connect('growll.db') con.text_factory = str cur = con.cursor() cur.execute("select temp from GrowLLDados") ar=[r[0] for r in cur.fet
import sqlite3
from matplotlib import pyplot
fig = pyplot.figure()
con = sqlite3.connect('growll.db')
con.text_factory = str
cur = con.cursor()
cur.execute("select temp from GrowLLDados")
ar=[r[0] for r in cur.fetchall()]
类似于“按id描述从GrowlDados订单中选择温度限制30”
其中,id
是一个自动递增计数器,或者至少意味着数字越高,条目越近 如何定义“最后”?