Search Postgresql Archives

Re: how to "group" several records with same timestamp into one line?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



zxo102 ouyang wrote:

> I would like to "group" them into one line with SQL like
>  
>    1.5     MPa   2.5    M3  3.5  M3   4.5   t   2008-11-12 12:12:12

Look up the "GROUP BY" clause.

http://www.postgresql.org/docs/current/static/sql-select.html

Note that with timestamps you may have to truncate/round them to the
desired precision, since current versions of PostgreSQL store timestamps
in a floating point format and two timestamps you'd expect to be equal
may not end up being seen as exactly equal.

--
Craig Ringer

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux