Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Android では、cursor.moveToLast() を使用してカーソル内の最後の項目をフェッチすることに非常に慣れています。ただし、Python の SQLite に相当するものが見つからないようです。カーソルの最後の行を取得できる関数はありますか?
cursor.fetchall() を呼び出してリストの最後の項目を取得することもできますが、それよりも効率的な方法はありますか? ありがとう。
cursor.execute("SELECT * FROM table ORDER BY id DESC LIMIT 1") result = cursor.fetchone()