我的结果不符合逻辑。查询以下
时,我得只有一个事件SELECT name, venue, location, start_time, eid FROM event
WHERE eid IN (
SELECT eid FROM event_member
WHERE (uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) OR uid = me())
)
AND start_time > now()
AND venue.latitude < '-22.821757'
AND venue.latitude > '-23.056989'
结果:
{
"data": [
{
"name": "Beijaço de recepção ao Papa Bento XVI",
"venue": {
"street": "",
"city": "",
"state": "",
"country": "",
"latitude": -22.97444595952,
"longitude": -43.187243996668,
"id": 152289418168750
},
"location": "Praia Copacabana - Rio de Janeiro - Brasil",
"start_time": "2013-07-23T14:00:00",
"eid": 304646919571378
}
]
}
但如果我删除了最后一行,只设置了一个纬度限制,我会得到一堆的结果,包括一些应该在完整查询上显示的内容,如:
{
"name": "Wobble apresenta: RUIDO",
"venue": {
"id": 245734958851552
},
"location": "00 Rio de Janeiro",
"start_time": "2013-02-15T22:00:00-0200",
"eid": 132007820298359
},
哪个地点有“纬度”:-22.978986942704
这是一个错误还是我做错了什么?
http://itouchmap.com/latlong.html - 如果您想使用自己的帐户进行测试,请检查您的自由度
https://developers.facebook.com/tools/explorer/ - Facebook的Graph API资源管理器
答案 0 :(得分:1)
您正在比较字符串而不是数字。
-22 > -23 = true
'-22' > '-23' = false
-22.9 < -22.8 = true
'-22.9' < '-22.8' = false