Re: Greater than a value

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Fontenot, Paul" <Paul(dot)Fontenot(at)bannerhealth(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Greater than a value
Date: 2003-06-26 21:43:09
Message-ID: 200306261443.09329.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Rudi Starcevic 2003-06-26 23:08:13 Address Table
Previous Message Nabil Sayegh 2003-06-26 21:27:20 Re: Fw: Removing foreign key and adding sequence