Re: Greater than a value

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Greater than a value
Дата
Msg-id 200306261443.09329.josh@agliodbs.com
обсуждение исходный текст
Ответ на Greater than a value  ("Fontenot, Paul" <Paul.Fontenot@bannerhealth.com>)
Список pgsql-novice
Paul,

> select count(*),msg_text from msg_table where msg_text like '%PIX-1%'
> COUNT => '50' group by msg_text order by count desc;
>
> Is that possible in PostgreSQL?

Yes.  You need an "intro to SQL" book to help you with this sort of thing;
consider "SQL Queries for Mere Mortals".

SELECT count(*) as no_msg, msg_text FROM msg_table
WHERE msg_text LIKE '%PIX-1%'
GROUP BY msg_text
HAVING count(*) >= 50
ORDER BY no_msg DESC;


--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


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

Предыдущее
От: Nabil Sayegh
Дата:
Сообщение: Re: Fw: Removing foreign key and adding sequence
Следующее
От: Rudi Starcevic
Дата:
Сообщение: Address Table