TPR
TPR

Reputation: 2577

Oracle - Why does it think it's missing a right parenthesis?

Why does Oracle think it's missing a right parenthesis?

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;

Upvotes: 0

Views: 400

Answers (1)

Justin Cave
Justin Cave

Reputation: 231651

In your inline view, your WHERE clause is after your GROUP BY. You would need to reverse that

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

Upvotes: 7

Related Questions