Re: ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D - Mailing list pgsql-sql

From Rodrigo Rosenfeld Rosas
Subject Re: ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D
Date
Msg-id 505118A7.9020104@gmail.com
Whole thread Raw
In response to ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D  (Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>)
Responses Re: ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D
List pgsql-sql
Em 12-09-2012 19:34, Gavin Flower escreveu: <blockquote cite="mid:50510E0C.8080704@archidevsys.co.nz" type="cite"><div
class="moz-cite-prefix">On13/09/12 09:44, Rodrigo Rosenfeld Rosas wrote:<br /></div><blockquote
cite="mid:CAGmv+wKCpc9VeyYp6nS9WL1vrtX=3+i87mFVMP4sEpB1LyPGQA@mail.gmail.com"type="cite"><pre wrap="">This is my first
messagein this list :)
 

I need to be able to sort a query by column A, then B or C (which one
is smaller, both are of the same type and table but on different left
joins) and then by D.

How can I do that?

Thanks in advance,
Rodrigo.


</pre></blockquote><font face="Courier New, Courier, monospace">...</font><font face="Courier New, Courier,
monospace"><br/> SELECT <br />     *<br /> FROM<br />     tabc t<br /> ORDER BY<br />     t.a,<br />     LEAST(t.b,
t.c),<br/>     t.d<br /> ...<br /></font></blockquote><br /> Thank you Gavin, I was looking for this LEAST function for
along time. I have tried MIN but it didn't work with strings.<br /><br /> I guess this will allow me to do what I want.
Thankyou so much!<br /><br /> Best,<br /> Rodrigo.<br /><br /> 

pgsql-sql by date:

Previous
From: Rodrigo Rosenfeld Rosas
Date:
Subject: Re: ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D
Next
From: Kjell Øygard
Date:
Subject: pg_restore problem