甲骨文 - 为什么它认为它缺少正确的括号?

时间:2012-04-24 21:54:17

标签: sql oracle

为什么Oracle认为它缺少正确的括号?

SELECT table2.name
    FROM (SELECT id, count (*) AS num
            FROM table1 GROUP BY id WHERE x = 1) 
    table1, table2, table3
    WHERE table2.temp_id = table3.temp_id AND
      table1.num > = s.num AND
      table2.id = table3.id;

1 个答案:

答案 0 :(得分:7)

在您的内联视图中,您的WHERE子句位于GROUP BY之后。你需要扭转那个

SELECT id, count (*) AS num
        FROM table1 WHERE x = 1 GROUP BY id)