Carol Cheung wrote:
> Hi,
> I have a table called temp
>
> access_date | active | status
> -++
> 2009-02-01 | t | 15
> 2009-02-01 | f | 16
> 2009-02-02 | f | 17
> 2009-02-01 | t | 17
> 2009-02-02 | f | 21
> 2009-
Carol Cheung writes:
> I tried something like
> SELECT to_char(access_date, 'MM') as year_month, count(year_month)
> FROM temp GROUP BY year_month ORDER BY year_month;
The only problem in what you wrote was the illegal cross-reference
from one output column to another. Just use count(*) ins
On Fri, Feb 27, 2009 at 2:02 PM, Carol Cheung
wrote:
> Hi,
> I have a table called temp
>
> access_date | active | status
> -++
> 2009-02-01 | t | 15
> 2009-02-01 | f | 16
> 2009-02-02 | f | 17
> 2009-02-01 | t | 17
> 2009-0
Hi,
I have a table called temp
access_date | active | status
-++
2009-02-01 | t | 15
2009-02-01 | f | 16
2009-02-02 | f | 17
2009-02-01 | t | 17
2009-02-02 | f | 21
2009-01-01 | t | 20
2009-01-01 | t
"delete" trigger should return "old".
In your code you return "new" for both: "update" and "delete"
Igor
-Original Message-
From: pgsql-sql-ow...@postgresql.org
[mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of Ivan Sergio
Borgonovo
Sent: Friday, February 27, 2009 6:56 AM
To: pgsql-sq
On Fri, 27 Feb 2009 12:56:06 +0100
Ivan Sergio Borgonovo wrote:
> I've:
>
> create or replace function FT1IDX_catalog_brands_update() returns
> trigger as $$
> begin
> if(TG_OP='DELETE') then
> update catalog_items set
> FT1IDX=GetFTIDX('pg_catalog.english', Code, CodeAlt, ISBN,
> Name, Au
I've:
create or replace function FT1IDX_catalog_brands_update() returns
trigger as $$
begin
if(TG_OP='DELETE') then
update catalog_items set
FT1IDX=GetFTIDX('pg_catalog.english', Code, CodeAlt, ISBN, Name,
Authors, '')
where BrandID=old.BrandID;
else
if(coalesce(new.Name,'')<>coa