Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 3F02463307D for ; Wed, 1 Apr 2009 12:08:29 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 43509-04 for ; Wed, 1 Apr 2009 12:08:27 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f167.google.com (mail-ew0-f167.google.com [209.85.219.167]) by mail.postgresql.org (Postfix) with ESMTP id 9B0F76318F3 for ; Wed, 1 Apr 2009 12:08:27 -0300 (ADT) Received: by ewy11 with SMTP id 11so113698ewy.19 for ; Wed, 01 Apr 2009 08:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=D75ki+GvTSm32ICPSwhF1ZE4dMV16NqQKj4FtnHmnvk=; b=tPQZ71N2AftciIJxRBDblzDjvdqzokJagB8TdB0LQIAxaMx3btal5oeWm0SeD+w8Fs pHyh2wtKsJZwjvyLKCXnvmDsEZCWXUX5a+InNmHeV1VWBx00m6u3R72BnmBTCogXgxCm FOtmi0da/9yk2lD8UodoEAAaCBj5y9mZev0Z0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=r5940zc2tLjoQiABgcmYeYXoYYhs+IATJsf4MBfks/1RNQITTDWGw1njnqgonDGNDR ug1gtBeVgb0ODmE6ayWX4faiR/qMVKFnaHcuv5mqyKTcAPYz85S+vgU0n1pQanHd1Te+ 4qj3LKAB9dEFIT9arbnM2ZxCZkprCNjoiaQW0= MIME-Version: 1.0 Received: by 10.210.62.3 with SMTP id k3mr3150618eba.68.1238598506186; Wed, 01 Apr 2009 08:08:26 -0700 (PDT) In-Reply-To: <49CCC24A.90800@vivawasser.de> References: <49CA6121.8090704@vivawasser.de> <49CCC24A.90800@vivawasser.de> Date: Wed, 1 Apr 2009 09:08:26 -0600 Message-ID: Subject: Re: Add: Special sort querstion From: Scott Marlowe To: d.piekarski@vivawasser.de Cc: pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL=0.003 X-Spam-Level: X-Archive-Number: 200904/3 X-Sequence-Number: 32349 On Fri, Mar 27, 2009 at 6:10 AM, Dominik Piekarski wrote: > Oh, actually every row of the same id-range has the same start_lat/start_lng > coordinates as the predecessors end_lat/end_lng coordinates. But the > question remains the same. Is there a way to do something like ORDER BY > (start_lat = end_lat AND start_lng = end_lng) ? Or maybe another way to > achieve the same result? Would something like order by start_lat-endlat, start_lng-end_lng OR case when start_lat=end_lat AND start_lng=end_lng then 0 else 1 end ???