pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mathieu Arnold <mat@mat.cc>
To: Joel Burton <joel@joelburton.com>
To: pgsql-sql@postgresql.org
Subject: Re: order by <something wierd>
Date: Tue, 14 May 2002 14:28:57 +0200
Message-ID: <1716030471.1021386536@andromede.reaumur.absolight.net> (raw)
In-Reply-To: <JGEPJNMCKODMDHGOBKDNKEBACOAA.joel@joelburton.com>
References: <JGEPJNMCKODMDHGOBKDNKEBACOAA.joel@joelburton.com>



--On mardi 14 mai 2002 08:05 -0400 Joel Burton <joel@joelburton.com> wrote:

> You're asking to have it be sorted as {2,1,3}, but the sample result data
> you give seems to sort by {1,2,3}. Or am I misunderstanding your question?

you're right, I messed up my example :)
I'll buy the second solution, it's the easier to put on.

> 2) inlined in sql
>
>   SELECT * FROM a
>   ORDER BY CASE WHEN col3=2 THEN 1
>                 WHEN col3=1 THEN 2
>                 ELSE 3
>             END;

-- 
Mathieu Arnold



view thread (8+ messages)  latest in thread

Message-ID: <1716030471.1021386536@andromede.reaumur.absolight.net>
Permalink:  ../1716030471.1021386536@andromede.reaumur.absolight.net/
Also on:    postgresql.org/message-id/1716030471.1021386536@andromede.reaumur.absolight.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mat@mat.cc, joel@joelburton.com
  Subject: Re: order by <something wierd>
  In-Reply-To: <1716030471.1021386536@andromede.reaumur.absolight.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox