| От | Robert B. Easter |
|---|---|
| Тема | Re: [BUGS] Re: Re: [SQL] MAX() of 0 records. |
| Дата | |
| Msg-id | 0007071258480C.01354@comptechnews обсуждение исходный текст |
| Ответ на | Re: [BUGS] Re: Re: [SQL] MAX() of 0 records. (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: [BUGS] Re: Re: [SQL] MAX() of 0 records.
|
| Список | pgsql-hackers |
On Fri, 07 Jul 2000, Tom Lane wrote: > Chris Bitmead <chris@bitmead.com> writes: > UPDATE foo > SET bar = (SELECT min(f1) FROM othertab > WHERE othertab.keycol = foo.keycol) > WHERE condition-determining-which-foo-rows-to-update > if you wanted to use an aggregate. This is pretty ugly, especially so If you use min(x) or max(x) frequently, isn't it best to make a trigger that intercepts x on insert and update, then check it and store it somewhere rather than scanning for it everytime? (not that this fixes any db problem thats being discussed here) -- Robert
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера