| От | Diogo Biazus |
|---|---|
| Тема | Re: join problem or maybe group :( |
| Дата | |
| Msg-id | 3D6E5EA3.7090309@ikono.com.br обсуждение исходный текст |
| Ответ на | Re: join problem or maybe group :( (Stephan Szabo <sszabo@megazone23.bigpanda.com>) |
| Список | pgsql-general |
I think that a subselect will do that, but I'm not sure if it is the best way. Try something like: select max(column1), (select column2 from table where column1 = (select max(column1) from table)) from table; >Just wonder, how can i do: > >select max(column1), column2 from table; > >its saying: >ERROR: Attribute table.column2 must be GROUPed or used in an aggregate >function > >and all i want is that column2 value will be the mate fo column1 max? > >like if >clumn1 column2 >1 a >2 b >3 c > >it will return 3,c > -- Diogo de Oliveira Biazus diogo@ikono.com.br Ikono Sistemas e Automação http://www.ikono.com.br
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера