Re: still sorting and casting problems

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: still sorting and casting problems
Дата
Msg-id 20020912065101.T45340-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на still sorting and casting problems  (juerg.rietmann@pup.ch)
Список pgsql-sql
On Thu, 12 Sep 2002 juerg.rietmann@pup.ch wrote:

>
> Hello there
>
> Unfortunately, I can't change the fieldtype that easy because other
> applications use the date as char(10) field as well.
>
> I need to sort the query by the log_date desc (log_date is char(10)). I
> tried the following without success :
>
> select id, log_date from userlog order by cast (log_date as date) desc
>
> select id, log_date from userlog order by date(log_date) desc
What do you get when trying this last query (something of the sort
works for me in 7.3beta).  It's possibly that you might need to use
date(log_date::text) desc, but without the error it's hard to say.




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

Предыдущее
От: "Gaetano Mendola"
Дата:
Сообщение: Re: Select the max on a field
Следующее
От: Jeff Eckermann
Дата:
Сообщение: Re: still sorting and casting problems