Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 50429 invoked from network); 31 Jan 2008 17:56:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Jan 2008 17:56:18 -0000 Received: (qmail 39608 invoked by uid 500); 31 Jan 2008 17:56:08 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 39592 invoked by uid 500); 31 Jan 2008 17:56:08 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 39581 invoked by uid 99); 31 Jan 2008 17:56:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Jan 2008 09:56:08 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Jan 2008 17:55:40 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1JKdda-0003oT-Qz for derby-user@db.apache.org; Thu, 31 Jan 2008 09:55:46 -0800 Message-ID: <15210361.post@talk.nabble.com> Date: Thu, 31 Jan 2008 09:55:46 -0800 (PST) From: tom_ To: derby-user@db.apache.org Subject: Re: distinct and order by In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tom12167@web.de References: <15206572.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org The errormessage is The ORDER BY clause may not specify an expression, since the query specifies DISTINCT [Error Code: 20000] [SQL State: 4287A] The statement is select distinct t1.t1_id, t2.t2value1, t2.t2value2, t2.t2value3 from t1, t2, t3 where ... order by lower(t2.t2value2) , lower(t2.t2value1) , lower(t2.t2value3) Dyre.Tjeldvoll wrote: > > tom_ writes: > >> I am using "disctinct" because of some self-joins and also needed to add >> an >> "order by" clause. An error is shown. Is it not possible to use distinct >> and >> order by together? > > I think it is allowed. Executing > > select distinct * from sys.systables order by tablename; > > in ij works just fine. Could you show the error message you get, and > perhaps what the table looks like? > > -- > dt > > -- View this message in context: http://www.nabble.com/distinct-and-order-by-tp15206572p15210361.html Sent from the Apache Derby Users mailing list archive at Nabble.com.