| От | Rod Taylor |
|---|---|
| Тема | Re: selecting entire row on which one field is the minimum |
| Дата | |
| Msg-id | 1053479672.24527.5.camel@jester обсуждение исходный текст |
| Ответ на | selecting entire row on which one field is the minimum (edouard.boucher@free.fr) |
| Список | pgsql-sql |
Something like this: SELECT a FROM table WHERE B = (SELECT min(B) FROM table); On Tue, 2003-05-20 at 21:16, edouard.boucher@free.fr wrote: > Hi, > > i have a table with 2 fields, let's say A and B, both integers. > i would like to select all the A for which the B are minimum > > i'm not sure i am clear, so here is an exemple : > > A | B > 1 | 5 > 2 | 2 > 3 | 3 > 4 | 2 > 5 | 2 > > in this situation, the query should return (2, 4, 5) > as it is very easy to ordre a table, i tought this query would be easy > too, but it is more difficult than it looks like. > > thanks for help > > > Edouard Boucher > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org -- Rod Taylor <rbt@rbt.ca> PGP Key: http://www.rbt.ca/rbtpub.asc
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера