Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: distinct

Re: distinct

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Thu, 8 Apr 2004 15:57:21 +0100
Message-ID: <40756851$0$6552$ed9e5944@reading.news.pipex.net>


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...

> 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
>
>
>
Received on Thu Apr 08 2004 - 09:57:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US