pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
showing records from the last 20 min
4+ messages / 3 participants
[nested] [flat]

* showing records from the last 20 min
@ 2003-03-18 18:00 Matthew Nuzum <cobalt@bearfruit.org>
  2003-03-18 18:19 ` Re: showing records from the last 20 min Tomasz Myrta <jasiek@klaster.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Matthew Nuzum @ 2003-03-18 18:00 UTC (permalink / raw)
  To: pgsql-sql

I know this is such a simple question, but I can't find the answer in
the manual and I've tried very hard to find it.

I want to show all the records in a table that occurred in the last 20
min.

So, maybe something like:
select * from sys_logins WHERE tstamp >= now() - '00:20';

on pg 7.3.2 this produces the error:
ERROR:  Bad timestamp external representation '00:20'
 
Thanks for any help,
-- 
Matthew Nuzum
cobalt@bearfruit.org
www.bearfruit.org




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: showing records from the last 20 min
  2003-03-18 18:00 showing records from the last 20 min Matthew Nuzum <cobalt@bearfruit.org>
@ 2003-03-18 18:19 ` Tomasz Myrta <jasiek@klaster.net>
  2003-03-18 18:36   ` Re: showing records from the last 20 min Matthew Nuzum <cobalt@bearfruit.org>
  2003-03-19 04:59   ` Re: showing records from the last 20 min Rajesh Kumar Mallah <mallah@trade-india.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Tomasz Myrta @ 2003-03-18 18:19 UTC (permalink / raw)
  To: Matthew Nuzum <cobalt@bearfruit.org>; +Cc: pgsql-sql

Użytkownik Matthew Nuzum napisał:
> I know this is such a simple question, but I can't find the answer in
> the manual and I've tried very hard to find it.
> 
> I want to show all the records in a table that occurred in the last 20
> min.
> 
> So, maybe something like:
> select * from sys_logins WHERE tstamp >= now() - '00:20';
> 
> on pg 7.3.2 this produces the error:
> ERROR:  Bad timestamp external representation '00:20'
>  
> Thanks for any help,
Did you mean:
select * from sys_logins
WHERE tstamp >= now()-cast('20:00' as interval);
?

Regards,
Tomasz Myrta




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: showing records from the last 20 min
  2003-03-18 18:00 showing records from the last 20 min Matthew Nuzum <cobalt@bearfruit.org>
  2003-03-18 18:19 ` Re: showing records from the last 20 min Tomasz Myrta <jasiek@klaster.net>
@ 2003-03-18 18:36   ` Matthew Nuzum <cobalt@bearfruit.org>
  1 sibling, 0 replies; 4+ messages in thread

From: Matthew Nuzum @ 2003-03-18 18:36 UTC (permalink / raw)
  To: Tomasz Myrta <jasiek@klaster.net>; +Cc: pgsql-sql

On Tue, 2003-03-18 at 13:19, Tomasz Myrta wrote:
> > I want to show all the records in a table that occurred in the last 20
> > min.
> > 
> > So, maybe something like:
> > select * from sys_logins WHERE tstamp >= now() - '00:20';
> Did you mean:
> select * from sys_logins
> WHERE tstamp >= now()-cast('20:00' as interval);

Yes, I guess I did.  ;-)  Thanks for the help.
-- 
Matthew Nuzum
cobalt@bearfruit.org
www.bearfruit.org




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: showing records from the last 20 min
  2003-03-18 18:00 showing records from the last 20 min Matthew Nuzum <cobalt@bearfruit.org>
  2003-03-18 18:19 ` Re: showing records from the last 20 min Tomasz Myrta <jasiek@klaster.net>
@ 2003-03-19 04:59   ` Rajesh Kumar Mallah <mallah@trade-india.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Rajesh Kumar Mallah @ 2003-03-19 04:59 UTC (permalink / raw)
  To: Tomasz Myrta <jasiek@klaster.net>; Matthew Nuzum <cobalt@bearfruit.org>; +Cc: pgsql-sql



the age function can also be used i guess.

where age(tstamp) <  '20 mins'::interval 


regds
mallah.

On Tuesday 18 Mar 2003 11:49 pm, Tomasz Myrta wrote:
> Użytkownik Matthew Nuzum napisał:
> > I know this is such a simple question, but I can't find the answer in
> > the manual and I've tried very hard to find it.
> > 
> > I want to show all the records in a table that occurred in the last 20
> > min.
> > 
> > So, maybe something like:
> > select * from sys_logins WHERE tstamp >= now() - '00:20';
> > 
> > on pg 7.3.2 this produces the error:
> > ERROR:  Bad timestamp external representation '00:20'
> >  
> > Thanks for any help,
> Did you mean:
> select * from sys_logins
> WHERE tstamp >= now()-cast('20:00' as interval);
> ?
> 
> Regards,
> Tomasz Myrta
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 
> 

-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2003-03-19 04:59 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-18 18:00 showing records from the last 20 min Matthew Nuzum <cobalt@bearfruit.org>
2003-03-18 18:19 ` Tomasz Myrta <jasiek@klaster.net>
2003-03-18 18:36   ` Matthew Nuzum <cobalt@bearfruit.org>
2003-03-19 04:59   ` Rajesh Kumar Mallah <mallah@trade-india.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox