Re: ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D

Поиск
Список
Период
Сортировка
От Rodrigo Rosenfeld Rosas
Тема Re: ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D
Дата
Msg-id 505118A7.9020104@gmail.com
обсуждение исходный текст
Ответ на ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D  (Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>)
Ответы Re: ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D
Список 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 по дате отправления:

Предыдущее
От: Rodrigo Rosenfeld Rosas
Дата:
Сообщение: Re: ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D
Следующее
От: Kjell Øygard
Дата:
Сообщение: pg_restore problem