2

尝试从 Amazon SimpleDB 请求按数字排序的记录列表时,我得到的结果非常不均衡。

我正在零填充我的数字以使它们按字典顺序选择,但仍然没有运气。这两个查询给出相同的结果,例如:

select * from cbcallers where calls_completed is not null order by calls_completed desc

select * from cbcallers where calls_completed is not null order by calls_completed asc

但是,我使用亚马逊的查询语言得到了正确的结果:

['calls_completed'starts-with ''] sort 'calls_completed' desc

上周,我在同一个数据集上从这个查询中得到了不同的(无序的)结果。有人知道发生了什么吗?我的查询被劫持了吗?

数据集如下所示:

Sdb-Item-Name、calls_completed、名称、图标
8uda23sd7, 0000002, 约翰·史密斯, /myimgicon.jpg
8uda5asd3, 0000015, 约翰·斯马特斯, /myimgicon2.jpg
8udassad8, 0000550, 约翰·斯莫吉, /myimgicon3.jpg
4

1 回答 1

1

您的查询看起来完全正确。我加载了您的数据并逐字使用了您的查询,得到了您所期望的结果。

上升:

select * from cbcallers where calls_completed is not null order by calls_completed asc
[
Item  8uda23sd7
  icon: myimgicon.jpg
  name: john smith
  calls_completed: 0000002, 
Item  8uda5asd3
  icon: myimgicon2.jpg
  name: john smarts
  calls_completed: 0000015, 
Item  8udassad8
  icon: myimgicon3.jpg
  name: john smoogie
  calls_completed: 0000550]

降序:

select * from cbcallers where calls_completed is not null order by calls_completed desc
[
Item  8udassad8
  icon: myimgicon3.jpg
  name: john smoogie
  calls_completed: 0000550, 
Item  8uda5asd3
  icon: myimgicon2.jpg
  name: john smarts
  calls_completed: 0000015, 
Item  8uda23sd7
  icon: myimgicon.jpg
  name: john smith
  calls_completed: 0000002]

也许这是您的 SimpleDB 客户端的问题,您使用的是哪一个,您知道它是否使用最新的 SimpleDB API 版本(“2009-04-15”)?

于 2010-02-12T13:05:10.677 回答