Re: Extracting time

From: Keary Suska <hierophant(at)pcisys(dot)net>
To: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Extracting time
Date: 2001-10-01 18:49:23
Message-ID: B7DE16D3.3EEC%hierophant@pcisys.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You are better off avoiding the overhead of calling a function:

SELECT * from table WHERE time + '30 minutes'::interval >= CURRENT_TIME

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

> From: "Krog, Kenneth" <KAKrog(at)MassMutual(dot)com>
> Date: Mon, 1 Oct 2001 13:09:02 -0400
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] Extracting time
>
> I am attempting to do a query for a specific time based of a response for
> a web site using php as the engine.
> The syntax of the sql is simple
>
> "SELECT * FROM table WHERE EXTRACT(MINUTE FROM fieldname)=$var;"
>
> Specifically I am trying to pull up the last 30 minutes worth of data that
> someone entered.
>
> Thanks in advance
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Creager, Robert S 2001-10-01 18:57:52 Re: question about indexing.
Previous Message rdack 2001-10-01 18:48:31 pypgsql 'create database' problem