Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: distinct
for select distinct the order by clause must be a column in the select list,
or a constant
try
SELECT distinct TRUNC(datetime)
FROM table1 WHERE object_nr=1
AND datetime BETWEEN('01.01.2004') AND ('18.03.2004')
AND value BETWEEN 1.5 AND 7.5
ORDER BY trunc(datetime)
/
why do you think that multiple rows are an issue
-- Niall Litchfield Oracle DBA Audit Commission UK http://www.niall.litchfield.dial.pipex.com/ "Andrea" <andrea75_at_yahoo.de> wrote in message news:c53okp$2of6a5$1_at_ID-98178.news.uni-berlin.de...Received on Thu Apr 08 2004 - 09:57:21 CDT
> Hi,
>
> I have the following SQL
>
> "SELECT TRUNC(datetime) FROM table1 WHERE object_nr=1 AND datetime
BETWEEN
> ('01.01.2004') AND ('18.03.2004') AND value BETWEEN 1.5 AND 7.5 ORDER BY
> datetime"
>
> I am getting multiple rows for the same date. Using of "SELECT DISTINCT
> TRUNC(...." I get
> ORA-01791.
> Any solutions to this problem?
>
> Regards
> Andrea
>
>
>