Re: [GENERAL] Help with sql

2012-07-07 Thread Chris Angelico
On Sat, Jul 7, 2012 at 11:48 PM, Perry Smith wrote: > The database is mostly static. I run through a very lengthy process to > populate the database maybe once a month and then it is 99% read-only. Do you run an ANALYZE on the table after populating it? Postgres needs up-to-date statistics for

Re: [GENERAL] Help with sql

2012-07-07 Thread Perry Smith
On Jul 6, 2012, at 7:56 PM, Steve Crawford wrote: > On 07/06/2012 02:34 PM, Perry Smith wrote: >> Hi Guys, >> >> This isn't a PostgreSQL specific question but just a SQL question. If this >> is not an appropriate question for this list, please let me know. >> >> It is also, perhaps, a really

Re: [GENERAL] Help with sql

2012-07-06 Thread Steve Crawford
On 07/06/2012 02:34 PM, Perry Smith wrote: Hi Guys, This isn't a PostgreSQL specific question but just a SQL question. If this is not an appropriate question for this list, please let me know. It is also, perhaps, a really silly question. This query (without the 'explain' keyword) , when exe

Re: [GENERAL] Help with sql

2012-07-06 Thread Rob Sargent
On 07/06/2012 03:34 PM, Perry Smith wrote: Hi Guys, This isn't a PostgreSQL specific question but just a SQL question. If this is not an appropriate question for this list, please let me know. It is also, perhaps, a really silly question. This query (without the 'explain' keyword) , when exe

Re: [GENERAL] help with SQL join

2010-02-12 Thread Igor Neyman
> -Original Message- > From: John R Pierce [mailto:pie...@hogranch.com] > Sent: Thursday, February 11, 2010 3:01 PM > To: pgsql-general@postgresql.org > Subject: Re: help with SQL join > > Neil Stlyz wrote: > > Now... here is the problem I am having... the above SQL query is > > retri

Re: [GENERAL] help with SQL join

2010-02-11 Thread John R Pierce
Neil Stlyz wrote: Now... here is the problem I am having... the above SQL query is retrieving results from one table: sales I have another table called customers with a couple of fields (customerid, and customername are two of the fields). I want to join on the customerid in both tables to retri

Re: [GENERAL] help with sql query

2006-10-18 Thread Albe Laurenz
Richard Broersma Jr wrote: >> id id_1id_2 date_time >> 1101 10002006-07-04 11:25:43 >> I want to find all records have same id_1, but different id_2 and have >> difference in time less than 5 minutes. >> In this case this is record 1 and record 3. >> How can I do this ? > > I a

Re: [GENERAL] help with sql query

2006-10-17 Thread Richard Broersma Jr
> idid_1id_2 date_time > 1 101 10002006-07-04 11:25:43 > I want to find all records have same id_1, but different id_2 and have > difference in time less than 5 minutes. > In this case this is record 1 and record 3. > How can I do this ? I am sure that this will need some "tu

RE: [GENERAL] Help with SQL Function

2001-01-08 Thread Jeff Eckermann
- > From: Tom Lane [SMTP:[EMAIL PROTECTED]] > Sent: Saturday, January 06, 2001 3:41 PM > To: Jeff Eckermann > Cc: [EMAIL PROTECTED] > Subject: Re: [GENERAL] Help with SQL Function > > Jeff Eckermann <[EMAIL PROTECTED]> writes: > > extracts=# create function tes