Re: [SQL] Update Problem

2006-06-06 Thread Andrew Sullivan
On Tue, Jun 06, 2006 at 01:04:26PM -, Christian Paul Cosinas wrote: > > > Sometimes only column1 and column2 is updated and column3 is not updated. Column 3 was already set to 08:00 AM? A -- Andrew Sullivan | [EMAIL PROTECTED] In the future this spectacle of the middle classes shocking

Re: [SQL] Advanced Query

2006-06-06 Thread codeWarrior
Personally: I think your posts are getting annoying. This isn't SQLCentral. Learn to write your own damn queries or even better - buy a book on SQL... <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi all, i posted this problem on the novice thread, > but it makes much more sense

Re: [SQL] Advanced Query

2006-06-06 Thread Richard Broersma Jr
> Personally: I think your posts are getting annoying. This isn't SQLCentral. > Learn to write your own damn queries or even better - buy a book on SQL... Personally: (being a newbie with an interest in developing a strong rdms skillset) I've enjoyed following threads like these. Even when the q

Re: [SQL] Advanced Query

2006-06-06 Thread Oisin Glynn
Richard Broersma Jr wrote: Personally: I think your posts are getting annoying. This isn't SQLCentral. Learn to write your own damn queries or even better - buy a book on SQL... Personally: (being a newbie with an interest in developing a strong rdms skillset) I've enjoyed following threa

Re: [SQL] Advanced Query

2006-06-06 Thread codeWarrior
I would hope that your choice to use postgreSQL is because it is superior technology that scales well financially... not because you get a warm fuzzy from all your friends on the mailing lists... "Oisin Glynn" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Richard Broersma Jr wr

Re: [SQL] Advanced Query

2006-06-06 Thread Scott Marlowe
On Tue, 2006-06-06 at 10:30, Richard Broersma Jr wrote: > > Personally: I think your posts are getting annoying. This isn't SQLCentral. > > Learn to write your own damn queries or even better - buy a book on SQL... > > Personally: (being a newbie with an interest in developing a strong rdms > sk

Re: [SQL] Advanced Query

2006-06-06 Thread Andrew Sullivan
On Tue, Jun 06, 2006 at 08:30:54AM -0700, Richard Broersma Jr wrote: > > However, if questions like these are *really* off-topic for the > pgsql-sql I would be interested in knowing what kind of threads are > acceptable and on-topic for this list. They're not off-topic. The point of the list is

Re: [SQL] Advanced Query

2006-06-06 Thread Andrew Sullivan
On Tue, Jun 06, 2006 at 09:20:13AM -0700, codeWarrior wrote: > I would hope that your choice to use postgreSQL is because it is superior > technology that scales well financially... not because you get a warm fuzzy > from all your friends on the mailing lists... I would hope that the tone of the

Re: [SQL] Advanced Query

2006-06-06 Thread Aaron Bono
Don't forget that support is a very important part of making a decision about whether to or not to use a technology.  Having people who are happy to read and respond to any question is part of great support for the product. And I am glad to see that most people on this list agree with me on the imp

Re: [SQL] How To Exclude True Values

2006-06-06 Thread operationsengineer1
> > > how can i exclude true values for this query? > > > > > > http://www.rafb.net/paste/results/obtkGz26.html > > > > > > if i uncomment out > > > > > > --AND t_inspect_result.inspect_result_pass = > 'f' > > > > > > it looks for prior falses within an inspect_id > and > > > returns it.

Re: [SQL] How To Exclude True Values

2006-06-06 Thread Richard Broersma Jr
> inspect_id, inspect_result_id, inspect_result_pass, > inspect_result_timestamp > 3, 5, f, 2006-06-05 05:00:00 > 3, 6, t, 2006-06-05 06:00:00 > 4, 7, f, 2006-06-05 07:00:00 > *4, 8, f, 2006-06-05 08:00:00* > the query linked in this post will return 3 lines... > > 1, 2, f > 3, 5, f > *4, 8, f* --

[SQL] Join issue

2006-06-06 Thread Burak Seydioglu
Hi,I have one to many (from left to right) relationships among the below tables in my databaseuser -> house -> contract -> contract status   |Also, a single house has a single provider and the provider has multiple rates inside the provider_rate table in chronological order.I have a que

Re: [SQL] Join issue

2006-06-06 Thread Andrew Sullivan
On Tue, Jun 06, 2006 at 11:10:46AM -0700, Burak Seydioglu wrote: > I have a query to return the latest contract and contract status for a > house... What i am trying to do is to get the rate of electricity for the > latest contract... I am trying to retrieve the latest provider rate before a > cont

Re: [SQL] How To Exclude True Values

2006-06-06 Thread operationsengineer1
> > inspect_id, inspect_result_id, > inspect_result_pass, > > inspect_result_timestamp > > 3, 5, f, 2006-06-05 05:00:00 > > 3, 6, t, 2006-06-05 06:00:00 > > 4, 7, f, 2006-06-05 07:00:00 > > *4, 8, f, 2006-06-05 08:00:00* > > the query linked in this post will return 3 > lines... > > > > 1, 2, f >

[SQL] How to get list of days between two dates?

2006-06-06 Thread Christine Desmuke
Hello, I'm trying to write a query and cannot figure out how to do it (or whether it can be done in SQL alone). Given a table containing events with their starting and ending days (may be single- or multi-day events), I need a list of the events occurring each day: CREATE TABLE test_events (

Re: [SQL] How to get list of days between two dates?

2006-06-06 Thread Aaron Bono
Though there may be a more eligant way to do it, when we did things like this in the past we created a function (or stored procedure) that got the min and max dates and then created a result set that iterated through the dates to create a virtual table of days.  Then you can inner join that list of

Re: [SQL] How to get list of days between two dates?

2006-06-06 Thread Scott Marlowe
On Tue, 2006-06-06 at 16:17, Aaron Bono wrote: > Though there may be a more eligant way to do it, when we did things > like this in the past we created a function (or stored procedure) that > got the min and max dates and then created a result set that iterated > through the dates to create a virtu

Re: [SQL] How To Exclude True Values

2006-06-06 Thread Richard Broersma Jr
> an inspection node (each row in t_inspect is an > inspection node) that has passed can't have a new > defect added - since it has already passed. > > therefore, in the defect entry form, i only want to > display those inspection nodes that don't have a true > value. by definition, a true valu

Re: [SQL] Join issue

2006-06-06 Thread operationsengineer1
> Hi, > > I have one to many (from left to right) > relationships among the below tables > in my database > > user -> house -> contract -> contract status >| > > Also, a single house has a single provider and the > provider has multiple > rates inside the provider_rate table in >

Re: [SQL] How To Exclude True Values

2006-06-06 Thread operationsengineer1
> > an inspection node (each row in t_inspect is an > > inspection node) that has passed can't have a new > > defect added - since it has already passed. > > > > therefore, in the defect entry form, i only want > to > > display those inspection nodes that don't have a > true > > value. by defin

Re: [SQL] How To Exclude True Values

2006-06-06 Thread Richard Broersma Jr
> Richard, that is the result i would need given that > data set. i have to digest this version, though. > > should this query be more efficient than the subquery > version as the table starts to get large? My experience is that Distinct On queries do not preform as well as their group by count

Re: [SQL] Join issue

2006-06-06 Thread Kenneth B Hill
That looks like a very complex query. I would like to suggest that you try doing some nesting queries via a SQL script. Make a "view" with a query, then perform a query using the view, etc. , then drop all views in the SQL script. This may make the entire operation perform faster. -Ken On Tue, 20

Re: [SQL] Join issue

2006-06-06 Thread Michael Glaesemann
On Jun 7, 2006, at 8:53 , Kenneth B Hill wrote: Make a "view" with a query, then perform a query using the view, etc. , then drop all views in the SQL script. This may make the entire operation perform faster. I don't know how using a view would improve performance. However, it may make the

Re: [SQL] How to get list of days between two dates?

2006-06-06 Thread Tim Middleton
This is going to be ugly, and I can't even say for sure it's right (and if by chance it is right, I imagine it still might be more efficient broken up in a function), but intrigued by learning about generate_series() from Scott Marlows response I fiddled until I got the results specified like th