limiting a select

Поиск
Список
Период
Сортировка
От Chris Thompson
Тема limiting a select
Дата
Msg-id Pine.LNX.4.33L2.0207041822480.26441-100000@boyce.ednet.co.uk
обсуждение исходный текст
Ответы Re: limiting a select  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-novice
Hi,
I am using the following query

    $query  = "SELECT id, title, type, SUBSTRING(description FOR $description_size) as description, ";
    $query .= "date, display_date ";
    $query .= "FROM events WHERE active='t' ";
    $query .= "ORDER BY date ASC;";

I was wondering if someone could give me a hint on how to alter this to
only return 9 results, of which there will, if available, be up to 3 of
each 'type' of event.

There are 3 possible values for the type column (text) in the db.

Any pointers appreciated,
Chris


--

This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender. Any
offers or quotation of service are subject to formal specification.
Errors and omissions excepted.  Please note that any views or opinions
presented in this email are solely those of the author and do not
necessarily represent those of edNET or lightershade ltd. Finally, the
recipient should check this email and any attachments for the presence of
viruses.  edNET and lightershade ltd accepts no liability for any damage
caused by any virus transmitted by this email.

--
--
Virus scanned by edNET.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: user-defined functions/triggers; cannot dump
Следующее
От: Josh Jore
Дата:
Сообщение: Re: determining Inheritance among tables