Re: [SQL] Summing & Grouping in a Hierarchical Structure

2013-02-18 Thread Relyea, Mike
> From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] > On Behalf Of Don Parris > Sent: Thursday, February 14, 2013 8:58 PM > To: pgsql-sql@postgresql.org > Subject: [SQL] Summing & Grouping in a Hierarchical Structure > > Hi all, > I posted to this list some time ago abo

Re: [SQL] Lowest 2 items per

2012-06-01 Thread Relyea, Mike
> -Original Message- > From: Oliveiros d'Azevedo Cristina [mailto:oliveiros.crist...@marktest.pt] > Sent: Friday, June 01, 2012 12:59 PM > To: Relyea, Mike > Cc: pgsql-sql@postgresql.org > Subject: Re: [SQL] Lowest 2 items per > > * I see... > >

Re: [SQL] Lowest 2 items per

2012-06-01 Thread Relyea, Mike
> -Original Message- > From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql- > ow...@postgresql.org] On Behalf Of Mario Dankoor > Sent: Friday, June 01, 2012 2:31 PM > To: Relyea, Mike > Cc: pgsql-sql@postgresql.org > Subject: Re: [SQL] Lowest 2 items per > Mike,

Re: [SQL] Lowest 2 items per

2012-06-01 Thread Relyea, Mike
> -Original Message- > From: Oliveiros d'Azevedo Cristina [mailto:oliveiros.crist...@marktest.pt] > Sent: Friday, June 01, 2012 12:28 PM > To: Relyea, Mike > Cc: pgsql-sql@postgresql.org > Subject: Re: [SQL] Lowest 2 items per > > Yes, you are right, now, thin

Re: [SQL] Lowest 2 items per

2012-06-01 Thread Relyea, Mike
> -Original Message- > From: Oliveiros d'Azevedo Cristina [mailto:oliveiros.crist...@marktest.pt] > Sent: Friday, June 01, 2012 11:21 AM > To: Oliveiros d'Azevedo Cristina; Relyea, Mike; pgsql-sql@postgresql.org > Subject: Re: [SQL] Lowest 2 items per > >

Re: [SQL] Lowest 2 items per

2012-06-01 Thread Relyea, Mike
> -Original Message- > From: David Johnston [mailto:pol...@yahoo.com] > Sent: Friday, June 01, 2012 11:13 AM > To: Relyea, Mike > Cc: > Subject: Re: [SQL] Lowest 2 items per > > > I would recommend using the "RANK" window function with an appropri

[SQL] Lowest 2 items per

2012-06-01 Thread Relyea, Mike
I need a little help putting together a query. I have the tables listed below and I need to return the lowest two consumables (ranked by cost divided by yield) per printer, per color of consumable, per type of consumable. CREATE TABLE printers ( printerid serial NOT NULL, make text NOT NULL,

Re: [SQL] simple? query

2009-08-14 Thread Relyea, Mike
> From: Jan Verheyden [mailto:jan.verhey...@uz.kuleuven.ac.be] > Sent: Friday, August 14, 2009 9:03 AM > To: Relyea, Mike > Subject: RE: [SQL] simple? query > > The goal is, where uid not equals to 'janvleuven10' a new > record should be inserted with the uid

Re: [SQL] simple? query

2009-08-14 Thread Relyea, Mike
> From: Relyea, Mike [mailto:mike.rel...@xerox.com] > Sent: Thursday, August 13, 2009 10:47 PM > > > From: pgsql-sql-ow...@postgresql.org > [mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of Jan Verheyden > > Subject: [SQL] simple? query > > > > Hi, > &g

Re: [SQL] simple? query

2009-08-13 Thread Relyea, Mike
> From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of Jan Verheyden > Subject: [SQL] simple? query > > Hi, > I was trying to run following query but doesn't work: > if (uid='janvleuven10') then > insert into test (registered) values ('1'); > else > insert

Re: [SQL] sequence number in a result

2008-10-09 Thread Relyea, Mike
> Is there a function or special system label I can use that would generate a sequence number in the returning result set? Would something like this work for you? CREATE TEMP SEQUENCE foo; SELECT a, b, c, nextval('foo') AS order FROM t1 ORDER BY a; Mike Relyea Product Development Engineer Xe