Hi all,
Because IN is semantically identical to =ANY
here the same error using ANY:
select * from emp where ename =ANY ( select ename from emp group by ename having 1 < count(ename) );
ename |empno|job | hiredate|sal |comm|deptno|level| mgr
------+-----+----------+----------+---------+----+------+-----+----
ALLEN | 7499|SALESMAN |1981-02-20|$1,600.00| 300| 20| 4|7782
BLAKE | 7698|MANAGER |1981-05-01|$2,850.00| | 30| 3|7782
JONES | 7900|CLERK |1981-12-03|$950.00 | | 30| 2|7782
MILLER| 7654|SALESMAN |1981-09-28|$1,250.00| 400| 30| 3|7839
CLARK | 7844|SALESMAN |1981-09-08|$1,500.00| | 10| 2|7839
KING | 7521|SALESMAN |1981-02-22|$1,250.00| 500| 10| 1|7782
ALLEN | 7499|SALESMAN |1981-02-20|$1,600.00| 300| 20| 4|7782
BLAKE | 7698|MANAGER |1981-05-01|$2,850.00| | 30| 3|7782
(8 rows)
but I expect the following instead:
ename |empno|job | hiredate|sal |comm|deptno|level| mgr
------+-----+----------+----------+---------+----+------+-----+----
ALLEN | 7499|SALESMAN |1981-02-20|$1,600.00| 300| 20| 4|7782
BLAKE | 7698|MANAGER |1981-05-01|$2,850.00| | 30| 3|7782
ALLEN | 7499|SALESMAN |1981-02-20|$1,600.00| 300| 20| 4|7782
BLAKE | 7698|MANAGER |1981-05-01|$2,850.00| | 30| 3|7782
(4 rows)
-Jose'-