Re: Alternative to MS Access Last() function

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Alternative to MS Access Last() function
Дата
Msg-id 20060301192439.GB14141@wolff.to
обсуждение исходный текст
Ответ на Re: Alternative to MS Access Last() function  ("Scott Ford" <Scott.Ford@bullfrogpower.com>)
Список pgsql-novice
On Wed, Mar 01, 2006 at 13:31:28 -0500,
  Scott Ford <Scott.Ford@bullfrogpower.com> wrote:
> Actually, I think I just figured it out.  I'm not sure that I totally
> understand it - I've been passed the problem of converting it from
> someone else.  But according to the documentation:
>
> -------------
> The LAST function returns the value of the last record in the specified
> field.
>
> Syntax:
> SELECT LAST(column) AS [expression]
> FROM table
>
> Example:
> SELECT LAST(Age) AS highest_age
> FROM Persons
> ORDER BY Age
> --------------
>
> So I think that I should just be able to use MAX().  Right?

You could more closely mimic this with a custom aggregate that returns the
value it was last input. However, depending on the context, you can probably
rewrite the queries to use max, min, or limit 1 with an an appropiate ordering
to do the same thing.

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

Предыдущее
От: "Lane Van Ingen"
Дата:
Сообщение: Re: install
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Alternative to MS Access Last() function