Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: query with Min function
Do not use the group by clause and you get only
the min(a.datainserimento).
Using the group by clause makes that you get one row for each group, because you use the PK as groups you get all the rows.
I do not understand "with the date nearest at other one
taken as input"
This condition would probably end up in the WHERE clause
ben brugman
"MARCOF" <wwwmarco_at_yahoo.it> wrote in message
news:84c9a426.0307110501.7d9fbb11_at_posting.google.com...
> I HAve a table (datitemppirisposta) (ORACLE)
> it has 3 colums
> DataInserimento, codicecontrollo, temporisposta
>
> The first 2 colims are primary key.
>
> I have to select "tempodirisposta" with the date nearest at other one
> taken as input
>
> Es.
> select
> min(a.datainserimento), a.temporisposta
> from
> datitempirisposta where
> a.codicecontrollo = 'C0005098' and
> a.datainserimento > to_Date('01/06/2003','dd/mm/yyyy')
> group by a.datainserimento, a.temporisposta
> order by a.datainserimento
>
> In this way i have got many rows instead i need only one row .
Received on Fri Jul 11 2003 - 08:11:12 CDT
![]() |
![]() |