2017-02-16 65 views
0

這是基於有效的SQL,但我不能讓它在DQL工作主義DQL如何寫SELECT EXISTS

SELECT 
    EXISTS (
     SELECT activity FROM Entity\Activity activity 
     WHERE activity MEMBER OF person.activities 
     AND activity.name = 'sports' 
    ) AS doesSports, 
    person.id 
FROM Entity\Person person 

這給了錯誤:

[Syntax Error] line 0, col 7: Error: Expected known function, got 'EXISTS' 

EXISTS似乎喜歡這個工作在WHERE但未選中

回答

0

語法不允許在SELECT子句中使用所謂的「其他表達式」,只允許使用函數。