Re: Seemingly inconsistent ORDER BY behavior

Поиск
Список
Период
Сортировка
От Richard Hipp
Тема Re: Seemingly inconsistent ORDER BY behavior
Дата
Msg-id CALwJ=Mx56v-Y=HnWnk829F6Doe_O65rkTV5+4Z0A7di9woBq7A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Seemingly inconsistent ORDER BY behavior  (Scott Marlowe <scott.marlowe@gmail.com>)
Ответы Re: Seemingly inconsistent ORDER BY behavior  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-general


On Wed, Aug 14, 2013 at 2:28 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
On Wed, Aug 14, 2013 at 12:01 PM, Richard Hipp <drh@sqlite.org> wrote:

substr(m,2) as m

is bad form. Always use a new and unique alias, like m1.  How does this work:

SELECT '2', substr(m,2) AS m1
  FROM t1
 ORDER BY lower(m1);

Tnx.  I think everybody agrees that "substr(m,2) as m" is bad form.  And all the database engines get the same consistent answer when you avoid the bad form and use "substr(m,2) as m1" instead.  The question is, what should the database engine do when the programmer disregards sounds advice and uses the bad form anyhow?

--
D. Richard Hipp
drh@sqlite.org

В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Seemingly inconsistent ORDER BY behavior
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Seemingly inconsistent ORDER BY behavior