[GENERAL] where clause question

2009-09-04 Thread Scott Frankel
Hello, Is it possible to perform selects in a where clause of a statement? Given a statement as follows: SELECT foo.foo_id, foo.name FROM foo, bar WHERE foo.bar_id = bar.bar_id AND bar.name = 'martini'; I'm looking for a way to recast it so that the select and from clauses

Re: [GENERAL] where clause question

2009-09-04 Thread Alban Hertroys
On 4 Sep 2009, at 15:47, Scott Frankel wrote: Hello, Is it possible to perform selects in a where clause of a statement? Given a statement as follows: SELECT foo.foo_id, foo.name FROM foo, bar WHERE foo.bar_id = bar.bar_id AND bar.name = 'martini'; I've explored the where

Re: [GENERAL] where clause question

2009-09-04 Thread Merlin Moncure
On Fri, Sep 4, 2009 at 9:47 AM, Scott Frankellekn...@pacbell.net wrote: Hello, Is it possible to perform selects in a where clause of a statement? Given a statement as follows:    SELECT foo.foo_id, foo.name    FROM foo, bar    WHERE foo.bar_id = bar.bar_id    AND bar.name = 'martini';

Re: [GENERAL] where clause question

2009-09-04 Thread David Fetter
On Fri, Sep 04, 2009 at 06:47:24AM -0700, Scott Frankel wrote: Hello, Is it possible to perform selects in a where clause of a statement? Given a statement as follows: SELECT foo.foo_id, foo.name FROM foo, bar WHERE foo.bar_id = bar.bar_id AND bar.name = 'martini'; I'm

[GENERAL] where clause question

2009-09-04 Thread Scott Frankel
Hello, Is it possible to perform selects in a where clause of a statement? Given a statement as follows: SELECT foo.foo_id, foo.name FROM foo, bar WHERE foo.bar_id = bar.bar_id AND bar.name = 'martini'; I'm looking for a way to recast it so that the select and from clauses

Re: [GENERAL] where clause question

2009-09-04 Thread Martin Gainty
responsabilité pour le contenu fourni. Date: Fri, 4 Sep 2009 10:21:24 -0700 From: da...@fetter.org To: lekn...@pacbell.net CC: pgsql-general@postgresql.org Subject: Re: [GENERAL] where clause question On Fri, Sep 04, 2009 at 06:47:24AM -0700, Scott Frankel wrote: Hello

[GENERAL] where clause help

2007-04-23 Thread Ketema
i have a record set like below: num_prods|num_open_issues|num_provisioned|num_canceled 1|0|1|0 2|0|0|2 3|0|1|1 2|0|1|1 1|0|01 2|0|0|0 3|3|0|0 3|0|0|3 3|1|0|2 3|2|0|1 2|0|2|0 Of the list above only row 3 and row 6 should be returned. Plain english definition: With a result set like above

Re: [GENERAL] where clause help

2007-04-23 Thread George Pavlov
Sent: Monday, April 23, 2007 4:21 PM To: pgsql-general@postgresql.org Subject: [GENERAL] where clause help i have a record set like below: num_prods|num_open_issues|num_provisioned|num_canceled 1|0|1|0 2|0|0|2 3|0|1|1 2|0|1|1 1|0|01 2|0|0|0 3|3|0|0 3|0|0|3 3|1|0|2 3|2|0|1 2|0|2|0

Re: [GENERAL] where clause help

2007-04-23 Thread Ketema
Man so simple! is your solution the same as: num_provisioned num_products AND (num_open_issues + num_provisioned + num_canceled) num_prods which is what i finally came up with ---(end of broadcast)--- TIP 5: don't forget to increase your

Re: [GENERAL] where clause help

2007-04-23 Thread Brent Wood
Ketema wrote: i have a record set like below: num_prods|num_open_issues|num_provisioned|num_canceled 1|0|1|0 2|0|0|2 3|0|1|1 * 2|0|1|1 1|0|0|1 2|0|0|0 * 3|3|0|0 3|0|0|3 3|1|0|2 3|2|0|1 2|0|2|0 Of the list above only row 3 and row 6 should be returned. Plain english definition: With a result

Re: [GENERAL] where clause help

2007-04-23 Thread Jorge Godoy
Ketema [EMAIL PROTECTED] writes: Man so simple! is your solution the same as: num_provisioned num_products AND (num_open_issues + num_provisioned + num_canceled) num_prods which is what i finally came up with This can be simplified to num_open_issues + num_provisioned + num_canceled

Re: [GENERAL] Where clause limited to 8 items?

2004-10-20 Thread Greg Stark
Henry Combrinck [EMAIL PROTECTED] writes: The above works fine - the index is used. However, extend the where clause with an extra line (say, col1 = 9) and the index is no longer used. Do explain analyze select ... with both versions and send the results (preferably without line wrapping

Re: [GENERAL] Where clause limited to 8 items?

2004-10-20 Thread Henry Combrinck
Henry Combrinck [EMAIL PROTECTED] writes: The above works fine - the index is used. However, extend the where clause with an extra line (say, col1 = 9) and the index is no longer used. Do explain analyze select ... with both versions and send the results (preferably without line

[GENERAL] Where clause limited to 8 items?

2004-10-19 Thread Henry Combrinck
Hello Searched around, but could not find this mentioned. I've noticed the following behaviour in 7.4.5: [explain analyse] select * from foo where col1 = 1 or col1 = 2 or col1 = 3 or col1 = 4 or col1 = 5 or col1 = 6 or col1 = 7 or col1 = 8; where an index on foo.col1 exists. The above works

Re: [GENERAL] Where clause limited to 8 items?

2004-10-19 Thread Stephan Szabo
On Wed, 20 Oct 2004, Henry Combrinck wrote: Hello Searched around, but could not find this mentioned. I've noticed the following behaviour in 7.4.5: [explain analyse] select * from foo where col1 = 1 or col1 = 2 or col1 = 3 or col1 = 4 or col1 = 5 or col1 = 6 or col1 = 7 or col1 =

[GENERAL] WHERE CLAUSE

2001-09-25 Thread Sameer Maggon
Hi, Well i have seen somewhere WHERE somefiled @ '{123,324}' what does this mean Sameer _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp ---(end of