Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help on Oracle SQL query
If I understand correctly this should do the trick
SELECT location, COUNT(location)
FROM ticket_table
WHERE row_num < 10
GROUP BY location
HTH
Colin.
BK wrote in message <354A55A7.331DAA1_at_watchmark.com>...
>Hi,
>
>I got a trouble ticket table with the following columns:
> Ticket_Id,
> Location,
> and some ticket info columns.
>
>I need to do a query that give me top ten locations with the most
>trouble ticket counts.
>
>I try this query
> select * from trouble_ticket where location =
> ( select location from trouble_ticket group by location having
>count(*) > 1);
>
>but this only provide me with locations that exceeded the threshold
>value for trouble count.
>
>Any idea?
>
>
>BK
>
Received on Sat May 02 1998 - 06:31:12 CDT
![]() |
![]() |