How to obtain the maximum value of a date, between 3 tables...

Поиск
Список
Период
Сортировка
От Andre Lopes
Тема How to obtain the maximum value of a date, between 3 tables...
Дата
Msg-id AANLkTi=HB8OWbBe-gtn3L4HaNMPeuWoEpnH=UkQ-j_6+@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to obtain the maximum value of a date, between 3 tables...  (Jon Nelson <jnelson+pgsql@jamponi.net>)
Re: How to obtain the maximum value of a date, between 3 tables...  (bricklen <bricklen@gmail.com>)
Re: How to obtain the maximum value of a date, between 3 tables...  ("Igor Neyman" <ineyman@perceptron.com>)
Список pgsql-general
Hi,

I need to obtain the maximum value of a date, but that comparison will be made between 3 tables... I will explain better with a query...

[code]
select
a.last_refresh_date as d1, ae.last_refresh_date as d2, ha.last_refresh_date as d3
from tbl1 a
join tbl2 ae on a.id_anuncio_externo = ae.id_anuncio_externo
join tbl3 ha on a.id_anuncio_externo = ha.id_anuncio_externo
[/code]

My question is how is the best way to obtain with date is the greatest, d1, d2 or d3

Can you guys give me a clue.

Best Regards,

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

Предыдущее
От: Dmitriy Igrishin
Дата:
Сообщение: OID of type by name.
Следующее
От: "Massa, Harald Armin"
Дата:
Сообщение: Re: Using PG with Windows EFS or TrueCrypt for encryption