取第一頁:
SELECT * FORM `article` OFFSET LIMIT 10取第二頁:
SELECT * FORM `article` OFFSET LIMIT 10 OFFSET 10取第三頁:
SELECT * FORM `article` OFFSET LIMIT 10 OFFSET 20
但 AWS SimpleDB 並不支援 offset 這個與法,必須要用 next_token 方式來取
以下用python boto library做個示例:
sdb_conn = SDBConnection(...)
# Skip first 20 items
query = "SELECT COUNT(*) FORM `article` OFFSET LIMIT 20"
rs = sdb_conn.select(sdb_domain, query=query)
# Get target page
query = "SELECT * FORM `article` OFFSET LIMIT 10"
rs2 = sdb_conn.select(sdb_domain, query=query, next_token=rs.next_token)
for item in rs2:
...
"SELECT COUNT(*)" 是最有效率的略過方法,如果用"SELECT * "則會有 return 2500 rows 的限制!
參考資料

回覆刪除Many businesses are increasingly turning to online resources to expand their reach. One useful tool is the website that offers valuable insights and services. By leveraging such platforms, companies can improve their digital presence and connect with a broader audience. Utilizing a reliable website is essential for success in today's competitive market.