Re: [SQL] Query from different Database

2004-10-07 Thread Robert Creager
When grilled further on (Thu, 7 Oct 2004 16:52:38 +0800 (MYT)), Abdul Wahab Dahalan <[EMAIL PROTECTED]> confessed: > I'm looking for a solution to make a query from two different databases. If > anybody has an experience or know how to solve it, please help me. Thanks. > I believe that the co

Re: [SQL] inverse of "day of year"

2004-03-19 Thread Robert Creager
When grilled further on (Fri, 19 Mar 2004 09:06:17 -0300), Martin Marques <[EMAIL PROTECTED]> confessed: > Is there a function that would give me the date for a given day of year? > > Something like the inverse of "EXTRACT(doy FROM date)"? > Something like: select date_trunc( 'year', now() ) +

Re: [SQL] Getting the week of a date

2004-02-16 Thread Robert Creager
When grilled further on (Mon, 16 Feb 2004 17:40:08 +0530), "Kumar" <[EMAIL PROTECTED]> confessed: > Dear Friends, > > Postgres 7.3.4 on RH Linux7.2. > > While this works for month and why not for week > date_trunc (obviously) doesn't support week. I ran into this a while ago, and came up with

Re: [SQL] max timestamp

2004-02-15 Thread Robert Creager
When grilled further on (10 Feb 2004 10:14:04 -0800), [EMAIL PROTECTED] (Michael Sterling) confessed: > i'm trying to get the max time stamp, from each day, of a range of > dates, not just the max time stamp for the complete range dates but > for each day. > Well, one gross and ugly way is: SE

Re: [SQL] Implementation of a bag pattern using rules

2004-02-09 Thread Robert Creager
When grilled further on (Mon, 09 Feb 2004 13:49:17 +), Mark Gibson <[EMAIL PROTECTED]> confessed: > I probably didn't make this clear enough: > Nah. After re-reading your e-mail, I say what I missed the first time. 'Bout 1 hour before my normal thinking time... Cheers, Rob -- 20:20:54

Re: [SQL] How can I get the last element out of GROUP BY sets?

2004-01-19 Thread Robert Creager
When grilled further on (Mon, 19 Jan 2004 00:44:30 -0500), Tom Lane <[EMAIL PROTECTED]> confessed: > Robert Creager <[EMAIL PROTECTED]> writes: > > ... one piece of data I need is the last value for each GROUP BY > > period. Alas, I cannot figure out how to do th

[SQL] How can I get the last element out of GROUP BY sets?

2004-01-18 Thread Robert Creager
I'm trying to produce summary data from a table (using PGSQL 7.4.1): CREATE TABLE readings( "when" timestamp, value integer ); The summary will be based on various time periods. I've been using date_trunc( 'hour', "when" ) and GROUP BY for the min/max/average readings with no problems. But, one

Re: [SQL] Problem with NOT IN portion of query.

2004-01-12 Thread Robert Creager
When grilled further on (Mon, 12 Jan 2004 07:28:09 +0100), Tomasz Myrta <[EMAIL PROTECTED]> confessed: > Dnia 2004-01-12 05:04, U¿ytkownik Robert Creager napisa³: > > > > SELECT date_trunc( 'hour', "when" )::timestamp AS > > period FROM r

[SQL] Problem with NOT IN portion of query.

2004-01-11 Thread Robert Creager
Hey All, Probably doing something stupid, and I'm too tired to see what. The query I'm trying to execute is: SELECT date_trunc( 'hour', "when" )::timestamp AS period FROM readings WHERE period NOT IN (SELECT "time" FROM hour.summary_period) GROUP BY period ORDER BY period; Where the table defi

Re: [SQL] grouping by date

2004-01-08 Thread Robert Creager
When grilled further on (Mon, 05 Jan 2004 17:14:26 +), teknokrat <[EMAIL PROTECTED]> confessed: > How can I group by date given a timestamp column? > I just found this out this weekend. Try 'date_trunc'. Look at secion 9.8.2 of the documentation. I'm using something like: SELECT date_tru

Re: [SQL] off subject - pg web hosting

2003-11-08 Thread Robert Creager
http://www.iniquinet.com When grilled further on (Thu, 6 Nov 2003 16:39:14 -0800 (PST)), chester c young <[EMAIL PROTECTED]> confessed: > can anybody recomend web hosting that provides postgresql? I have > found a couple, but their pricing is several times the going rate using mySql. > -- 1