pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Fwd: Stalled post to pgsql-sql
3+ messages / 3 participants
[nested] [flat]

* Fwd: Stalled post to pgsql-sql
@ 2006-06-01 18:42 Aaron Bono <aaron.bono@aranya.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Aaron Bono @ 2006-06-01 18:42 UTC (permalink / raw)
  To: pgsql-sql

I think this approach will only work if each broadcast_id has the same
maximum date_sent value.  You really need to do the group by in a
sub-query to bring the broadcast_id together with the max date_sent.

-Aaron Bono

On 6/1/06, Yasir Malik <ymalik@cs.stevens.edu> wrote:
> > What I would like to do is simply get the last date_sent and it's
> > status for every broadcast.  I can't do a GROUP BY because I can't put
> > an aggregate on the status column.
> >
> > SELECT MAX(date_sent), status
> > FROM broadcast_history
> > GROUP BY broadcast_id
> >
> You could try the following:
> select status
>    from broadcast_history bh
>   where bh.date_sent =
>         (select max(bh2.date_sent)
>            from broadcast_history bh2);
>



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

* Re: Stalled post to pgsql-sql
@ 2009-12-09 10:30 sergey kapustin <kapustin.sergey@gmail.com>
  2009-12-09 10:33 ` Re: Stalled post to pgsql-sql Pavel Stehule <pavel.stehule@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: sergey kapustin @ 2009-12-09 10:30 UTC (permalink / raw)
  To: pgsql-sql

Hello,
I need a type that will store date and time, but without seconds and
microseconds (like timestamp does). At least without microseconds.
I also need all the operators to work.
Is this possible with one of existing date/time types or i need to create my
own?

Thank you!

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

* Re: Stalled post to pgsql-sql
  2009-12-09 10:30 Re: Stalled post to pgsql-sql sergey kapustin <kapustin.sergey@gmail.com>
@ 2009-12-09 10:33 ` Pavel Stehule <pavel.stehule@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Pavel Stehule @ 2009-12-09 10:33 UTC (permalink / raw)
  To: sergey kapustin <kapustin.sergey@gmail.com>; +Cc: pgsql-sql

hello
postgres=# create table foo(a timestamp(0));
CREATE TABLE
Time: 111,105 ms
postgres=# insert into foo values(now());
INSERT 0 1
Time: 1,292 ms
postgres=# select now(), a from foo;
              now              |          a
-------------------------------+---------------------
 2009-12-09 11:33:22.746217+01 | 2009-12-09 11:33:12
(1 row)

Time: 21,010 ms

regards
Pavel Stehule


2009/12/9 sergey kapustin <kapustin.sergey@gmail.com>:
> Hello,
> I need a type that will store date and time, but without seconds and
> microseconds (like timestamp does). At least without microseconds.
> I also need all the operators to work.
> Is this possible with one of existing date/time types or i need to create my
> own?
>
> Thank you!
>



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


end of thread, other threads:[~2009-12-09 10:33 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-01 18:42 Fwd: Stalled post to pgsql-sql Aaron Bono <aaron.bono@aranya.com>
2009-12-09 10:30 Re: Stalled post to pgsql-sql sergey kapustin <kapustin.sergey@gmail.com>
2009-12-09 10:33 ` Pavel Stehule <pavel.stehule@gmail.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