Re: NEWBIE: How do I get the oldest date contained in 3 tables
В списке pgsql-general по дате отправления:
| От | Brent Wood |
|---|---|
| Тема | Re: NEWBIE: How do I get the oldest date contained in 3 tables |
| Дата | |
| Msg-id | 461ABCFD.7050102@niwa.co.nz обсуждение исходный текст |
| Ответ на | NEWBIE: How do I get the oldest date contained in 3 tables (Lorenzo Thurman <lorenzo@diespammerhethurmans.com>) |
| Ответы |
Re: NEWBIE: How do I get the oldest date contained in 3 tables
|
| Список | pgsql-general |
Lorenzo Thurman wrote: > I have three tables using date fields. I want to retrieve the oldest > date contained in the tables. Can someone show me an example of a > query that would do that? You could write a custom function doing the same sort of thing, or (perhaps more portable) use generic sqls & views like: create view min_dates as select min(date1) from table1as date_1 union select min(date2) from table2 as date_1 union select min(date3) from table3 as date_1; then either: select min(date_1) from min_dates; or create view min_date as select min(date_1) as min_date from min_dates; then just: select min_date from min_date; Cheers Brent Wood
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера