Re: [SQL] Howto get a group_number like row_number for groups

2010-04-12 Thread msi77
Hi, dense_rank() over (order by object) % 2 > Hi > I'd like to have an alternating colorindex in the output of a query that > consecutive rows that are the same within a colum the same number. > The query generates a readable output from a log-table and a few others > that hold referenc

Re: [SQL] Howto get a group_number like row_number for groups

2010-04-08 Thread Jaime Casanova
On Thu, Apr 8, 2010 at 2:51 PM, Andreas wrote: > or rank()  over  (order by  object,   ts)  %  2 use dense_rank() instead -- Atentamente, Jaime Casanova Soporte y capacitación de PostgreSQL Asesoría y desarrollo de sistemas Guayaquil - Ecuador Cel. +59387171157 -- Sent via pgsql-sql mailing l

[SQL] Howto get a group_number like row_number for groups

2010-04-08 Thread Andreas
Hi I'd like to have an alternating colorindex in the output of a query that consecutive rows that are the same within a colum the same number. The query generates a readable output from a log-table and a few others that hold referenced texts. log (log_id int, log_event_fk int, object_fk i