2012-12-07 23 views
0
select name, birthday 
from user 
where uid in (SELECT uid2 FROM friend WHERE uid1 = me()) 
    and birthday != null; 

結果如何使用fql過濾null?

{ 
    "error": { 
    "message": "(#602) NULL is not a member of the user table.", 
    "type": "OAuthException", 
    "code": 602 
    } 
} 

我能以某種方式篩選出空值?

+0

哎呀,我還以爲你的代碼爲SQL。抱歉! –

+0

好吧,你不能,你需要讓你的代碼足夠靈活,以便它檢測到null並且跳過它們 –

回答

0

無需使用STR *函數的幾個月越來越常用字母...只需使用「其中」排除空值或「字段」以排除非空值。對於這個特殊的例子:

選擇的名字,從用戶 生日 哪裏生日 和uid中(選擇UID2從相知WHERE UID1 =我())

0

這應該撤出所有它的工作零點在年度

SELECT name, birthday, email, uid FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me()) AND (strpos(lower(birthday),"a") >=0 OR strpos(lower(birthday),"e") >=0 OR strpos(lower(birthday),"u") >=0) ORDER BY birthday_date