The table structure is as follows:
NOTE: The names used are for illustrative purposes only.
Table T1 - col1 INT, col2 CHAR, col3 VARCHAR
Table T2 - col1 INT, col2 VARCHAR col3 CHAR
Table T3 - col1 INT - col1 from Table 2 col2 INT - col2 from Table T col3 INT
SELECT tt1.col2, COUNT(tt1.col1) FROM T1 tt1, T2 tt2, T3 tt3 WHERE tt2.col1 = tt3.col1 AND
tt3.col2 = tt1.col1 GROUP BY tt1.col1, tt1.col2 HAVING EVERY (tt2.col3 = 'something');
This shows an error that matches the title of the question; However, no error is reported if I remove the HAVING clause.
Is the query syntactically correct?
havingclause into thewhere. The specific problem is that you've added the word "EVERY", which is not Oracle syntax. - Benwhereclause. You're using implicit inner joins so you're not going to turn an outer join into an inner join mistakenly. - Ben