Your query should take this form:
select dummy,
       (select count(dummy)from dual) x
       from dual;

You don't need the last group by because none of the columns you are
selecting is an aggregate function.
True that one of your columns:
 (select count(a.mch_code) from ifsinfo.cust_warr_detail a
               where   a.valid_until >= c.valid_until and
                               a.description=c.description
               group by a.mch_code)
is the RESULT of an aggregate function, but it itself is not an aggregate
function column.
Mike

On Thu, Dec 11, 2008 at 9:59 PM, Jaska <[email protected]> wrote:

>
> Hi.
>
> I tried to make list how many machine (mch_code) is under warranty in
> each month.
> Valid_until is like YYYYMM. Description is type of machine.
>
> select  c.valid_until,
>                c.description,
>                (select count(a.mch_code) from ifsinfo.cust_warr_detail a
>                where   a.valid_until >= c.valid_until and
>                                a.description=c.description
>                group by a.mch_code)
>
> from    ifsinfo.cust_warr_detail c
>
> group by        c.valid_until,
>                c.description
>
>
> This query gives error "Not group by expression".
>
> I have tried to add whole subquery to main Group by section but it
> didn't solve this..
> System gives error: "Subquery expressions not allowed here".
>
>
> Do someone knows what kind of SQL query is should use?
>
> Thanks!
>
>
> Ps.
> Also one working solution is that machine is listed every "month" if
> machine is under warranty on that month.
> So I can group/count these in Excel with pivot.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to