Re: [SQL] reduce many loosely related rows down to one

2013-05-28 Thread Bill MacArthur
On 5/28/2013 11:04 AM, Torsten Grust wrote: On 25 May 2013, at 9:19, Bill MacArthur wrote (with possible deletions): [...] select * from test; id | rspid | nspid | cid | iac | newp | oldp | ppv | tppv +---+---+-+-+--+--+-+- 1 | 2 | 3

Re: [SQL] reduce many loosely related rows down to one

2013-05-27 Thread Bill MacArthur
On 5/25/2013 7:57 AM, Marc Mamin wrote: Von: pgsql-sql-ow...@postgresql.org [pgsql-sql-ow...@postgresql.org]" im Auftrag von "Bill MacArthur [webmas...@dhs-club.com] Gesendet: Samstag, 25. Mai 2013 09:19 An: pgsql-sql@postgresql.org Bet

[SQL] reduce many loosely related rows down to one

2013-05-25 Thread Bill MacArthur
xperimented with doing the aggregates as a CTE and then joining that to various incarnations of DISTINCT and DISTINCT ON, but those do not do what I want. Trying to find the right combination of terms to get an answer from Google has been unfruitful. Any ideas? Thank you for your considerati

Re: [SQL] Getting the output of a function used in a where clause

2005-04-22 Thread Bill Lawrence
, Thanks for all the great advice! -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Monday, April 18, 2005 8:00 PM To: Rod Taylor Cc: Bill Lawrence; Scott Marlowe; PFC; pgsql-sql@postgresql.org Subject: Re: [SQL] Getting the output of a function used in a where clause

Re: [SQL] Getting the output of a function used in a where clause

2005-04-18 Thread Bill Lawrence
Thanks, Unfortunately, I think that solution requires the distance calculation to be executed twice for each record in the table. There are ~70K records in the table. Is the postgres query optimizer smart enough to only perform the calculation once? Bill -Original Message- From: Scott

Re: [SQL] Getting the output of a function used in a where clause

2005-04-12 Thread Bill Lawrence
Thanks a bunch! Looks pretty step-by-step at the site for the link you sent. I'll give it a shot and see how it turns out. Thanks again for all your help! Bill -Original Message- From: PFC [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 12, 2005 1:03 AM To: Bill Lawrence Subjec

Re: [SQL] Getting the output of a function used in a where clause

2005-04-11 Thread Bill Lawrence
Boy I sure thought that would work... I received the following from postgres: ERROR: Attribute "distance" not found. Started looking into gist Looks complex. Any other ideas? -Original Message- From: PFC [mailto:[EMAIL PROTECTED] Sent: Monday, April 11, 2005 1:51 A

[SQL] Getting the output of a function used in a where clause

2005-04-10 Thread Bill Lawrence
ing like: $sql = “SELECT zipcode, distance from zipcodes where distance <= $dist order by distance;”; But I don’t the magic SQL phrase to populate the distance variable using my nifty function. Do I need to create an output type for distance? Thanks in advance! Bill      

Re: [SQL] Database reporting tool

2004-03-26 Thread Bill
like Oracle, MySQL, DB2, and SQL Server. Thanks Bill Kotraba LogiXML > On Wed, Mar 10, 2004 at 02:17:31PM +0800, [EMAIL PROTECTED] wrote: > > > > i'm using PostgreSQL as my database and now i'm looking for a good > > reporting tools(can do ad-hoc queries &

Re: [SQL] [PERFORM] Set-Returning Functions WAS: On the performance of

2004-02-01 Thread Bill Moran
Josh Berkus wrote: Bill, I don't understand at all. If I do "SELECT * FROM set_returning_function()" and all I'm going to do is iterate through the columns and rows, adding them to a two dimensional array that will be marshalled as a SOAP message, what about not knowing the

Re: [SQL] [PERFORM] Set-Returning Functions WAS: On the performance of

2004-02-01 Thread Bill Moran
Josh Berkus wrote: Bill, First off: discussion moved to the SQL list, where it really belongs. True, it started out as [PERFORM], but is no longer. Well, I would have agreed with the uselessness, until this project. The "source of endless debugging" frightens me! Well, the last time

Re: [SQL] PG equivalent to Sybase varbinary

2003-10-14 Thread Bill Pfeiffer
Thanks for the response. I'll look into re-running the ddl using the bytea datatype the next time I perform the setup I'm using. (I used a Sybase SQL Anywhere db in the meantime to get me back on track with the task at hand). Thanks again, Bill "Richard Huxton" <[EMA

[SQL] PG equivalent to Sybase varbinary

2003-10-07 Thread Bill Pfeiffer
Anybody know what the Postgresql equivalent to a Sybase varbinary data type is? I have a package that provides ddl to store a 40 byte/char? varbinary column in a table and it is failing against postrgresql. Thanks for any help and if more info is need to answer, please let me know. Bill

Re: [SQL] LEAST and GREATEST functions?

2003-07-02 Thread Stefan Bill
It's good to hear this kind of discussion going on! I solved my problem (for now) by creating a bunch of overloaded LEAST and GREATEST functions, one for each datatype. They only take two parameters, but that's fine for what we're doing. However, I ran into another, unrelated problem. I created

Re: [SQL] LEAST and GREATEST functions?

2003-07-01 Thread Stefan Bill
> Um, what's wrong with MAX and MIN, exactly? MIN and MAX are aggregate functions, LEAST and GREATEST are not. See the examples on the following table: foo A B - - 1 4 2 3 3 2 > SELECT LEAST(a, b), GREATEST(a, b) FROM foo; LEAST(a, b) GREATEST(a, b) --- -- 1 4 2

[SQL] LEAST and GREATEST functions?

2003-06-30 Thread Stefan Bill
Hi, I know the LEAST and GREATEST functions are not part of standard SQL, but they sure were handy where I came from (Oracle-land). Has anyone written user-defined functions that do the same thing? Are there any plans to add these functions as part of a future version Postgres? Thanks, -Stefan

[SQL] Function define question

2001-08-17 Thread Bill
Hello all, Is it possible to define a function to pass parameter like this? function( parameter ) but not function( 'parameter' ) Regards Bill ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.post

[SQL] Thanks

2001-08-15 Thread Bill
to write a function that pass the parameter like the DataDiff function, I mean: DataDiff( Year, date1, date2) but not DataDiff( 'Year', date1, date2) Is it possible to doing this? Define a enum data type? Thanks Bill ---(end of

[SQL] Re: DateDiff, IsNull?

2001-08-14 Thread Bill
IsNull work like this SELECT IsNull( user_name, '') FROM user ; then the query will return empty string when the field user_name is null Regards Bill > > Hello all, > > > > I am a newbie to postgreSQL, is it possible to write a "DateDiff", > > &

[SQL] DateDiff, IsNull?

2001-08-14 Thread Bill
Hello all, I am a newbie to postgreSQL, is it possible to write a "DateDiff", "IsNull" function work same as the one in SQL Server and are there and sample out there? And is it possible to override the existing function and operator like "+" to b

Re: [SQL] postmaster: init.d/start

2000-06-12 Thread Bill Anderson
Markus Wagner wrote: > > Hi Daniel, > > thank you for your reply. > > There are some unanswered questions. > Why does one have to consider multiple run levels? Doesn't run level 3 > (network + X) implicate run level 2 (network)? > So if I don't use XDM (or equivalent) and the system starts with

Re: [SQL] New book on Postgres

2000-06-06 Thread bill
Hello! wers regarding a book proposal on Regarding the book proposal on Postgres: I can tell you that the world needs a Postgres book! Specifically, I would like to see the following topics covered: - table-inheritance: what does it mean, how does it work, examples - regular expressions in que

[SQL] I'm missing outer joins

2000-06-01 Thread bill
n two tables (where one table may have no matching rows) via a single sorted query? Thanks! Bill