Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: a select within a count ??
Originally posted by Andre
> Hello all,
>
> I have a query, but it's not working.
>
> Can someone help me:
>
> select count(*), count(select distinct My_id from Anytable where My_id
> < 1000) from Anytable;
>
> In other words I want to execute a subquery within a count-statement.
> Is it possible ???
>
> Thx!,
> Andre
I can't understand what you want to do either. But instead of
count(select) it should be select(count), e.g.
SQL> select deptno, (select count(*) from emp where deptno=dept.deptno)
SQL> emp_count
2* from dept;
DEPTNO EMP_COUNT
---------- ----------
10 3 20 5 30 6 40 0
-- Posted via http://dbforums.comReceived on Tue Jul 01 2003 - 05:15:16 CDT
![]() |
![]() |