Re: group by and order by question

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: group by and order by question
Дата
Msg-id 200012270105.eBR15RP17365@linda.lfix.co.uk
обсуждение исходный текст
Ответ на group by and order by question  (GH <grasshacker@over-yonder.net>)
Список pgsql-general
GH wrote:
...
  >So the table would look like:
  >id|   url   |link_text | type |disp_place
  >--+---------+----------+------+----------
  >1 | myurl   | My URL   | 1    | 1
  >2 | yoururl | Your URL | 2    | 3
  >3 | hisurl  | His URL  | 1    | 4
  >
  >I would need a result like
  >type | url     | disp_place
  >-----+---------+----------
  > 1   | myurl   |  1
  > 1   | hisurl  |  4
  > 2   | yoururl |  3
  >etc.

SELECT type, url, disp_place
  FROM links
  ORDER BY type, disp_place;




--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "And they said, Believe on the Lord Jesus Christ, and
      thou shalt be saved, and thy house."      Acts 16:31



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

Предыдущее
От: "Tim Barnard"
Дата:
Сообщение: PQsetnonblocking question
Следующее
От:
Дата:
Сообщение: Auto Increment