Re: how to select a time frame on timestamp rows.

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: <bartschm(at)psi(dot)com>
Cc: Postgres SQL list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: how to select a time frame on timestamp rows.
Date: 2001-01-14 01:10:18
Message-ID: Pine.LNX.4.30.0101140208531.965-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

bartschm(at)psi(dot)com writes:

> today i was trying to perform a query on a database using a time stamp
> field, i need to get all records which belong to year 2000, month 11,
> is there any other way to doit, or is this the pgsql way? , actually
> i'm using a query like this:
> select User_Name from tbacct where acct_timestamp like '2000-11%' group
> by User_Name;

select user_name from tbacct where extract(month from acct_timestamp) = 11 ...

(SQL compliant)

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message bartschm 2001-01-14 01:40:51 Re: how to select a time frame on timestamp rows.
Previous Message bartschm 2001-01-14 00:24:08 how to select a time frame on timestamp rows.