2012-03-08 226 views
0

我只是用SQL開始,當我試圖運行,下面這段代碼,它顯示錯誤「缺少右括號」缺少右括號

SELECT a.author 
FROM DLESSA.DBLP_AUTHOR a 
WHERE a.authorId IN 
(SELECT ea.authorId 
FROM DLESSA.DBLP_ENTITY_ARTICLE ea 
WHERE ea.entityId IN 
(SELECT ea.entityId  
FROM DBLP_ENTITY_ARTICLE ea JOIN DBLP_ENTITY_AUTHOR ea1 ON ea1.entityId=ea.entityId ea1 JOIN DLESSA.DBLP_AUTHOR a ON a.authorId=ea1.authorId ea 
WHERE ea.Author LIKE 'Tongs%')); 

有人可以告訴我在哪裏我的錯誤是什麼?數百萬的感謝!

+0

你已經張貼在這裏丟失沒有括號(除非你的數據庫系統的SQL味道,需要封閉在括號中加入,這是不是你所要求的,當然的特定摘錄)。 – 2012-03-08 22:45:51

回答

2

格式揭示了原因:

SELECT a.author 
FROM DLESSA.DBLP_AUTHOR a 
WHERE a.authorId IN 
    (SELECT ea.authorId 
     FROM DLESSA.DBLP_ENTITY_ARTICLE ea 
     WHERE ea.entityId IN 
      (SELECT ea.entityId  
      FROM DBLP_ENTITY_ARTICLE ea    
       JOIN DBLP_ENTITY_AUTHOR ea1 
       ON ea1.entityId=ea.entityId ea1  --- aliases? 
       JOIN DLESSA.DBLP_AUTHOR a 
       ON a.authorId=ea1.authorId ea    --- here? 
      WHERE ea.Author LIKE 'Tongs%' 
     ) 
    ); 
+1

+1即使嘗試... – 2012-03-08 18:56:25