Re: [SQL] Cursors..

2008-08-19 Thread Yura Gal
Take a look at http://www.postgresql.org/docs/8.3/interactive/plpgsql-cursors.html and you'll find answer you need. > I need to convert this cursor of Oracle to Postgres... > I wait for your help!! -- Best regards, Yuri. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make ch

Re: [SQL] Join question

2008-08-19 Thread Edward W. Rouse
I thought of that, but it does violate table constraints. Edward W. Rouse From: Oliveiros Cristina [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2008 2:00 PM To: pgsql-sql@postgresql.org; [EMAIL PROTECTED] Subject: Re: [SQL] Join question I don't understand your count(total) expre

Re: [SQL] Join question

2008-08-19 Thread Edward W. Rouse
I have tried left, right outer and inner. Edward W. Rouse From: Daniel Hernandez [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2008 12:30 PM To: pgsql-sql@postgresql.org; [EMAIL PROTECTED] Subject: Re: [SQL] Join question have you tried a right Join? Daniel Hernndez. San Diego,

Re: [SQL] Join question

2008-08-19 Thread Oliveiros Cristina
Already tried making two queries and then outputting the UNION of the results? The second one could be something like this... SELECT org,null,COUNT(color) FROM b WHERE user IS NULL AND org = 'a' GROUP BY org Best, Oliveiros - Original Message - From: Edward W. Rouse To: pgsql-sql

Re: [SQL] Join question

2008-08-19 Thread Lennin Caro
--- On Tue, 8/19/08, Edward W. Rouse <[EMAIL PROTECTED]> wrote: > From: Edward W. Rouse <[EMAIL PROTECTED]> > Subject: Re: [SQL] Join question > To: "'Daniel Hernandez'" <[EMAIL PROTECTED]>, pgsql-sql@postgresql.org > Date: Tuesday, August 19, 2008, 1:35 PM > I have tried left, right outer and

Re: [SQL] Join question

2008-08-19 Thread Edward W. Rouse
I was trying to do something like this, but couldn't get it to work. I am trying to follow the example you provided, but don't understand how id and oid relate to the example tables and which table is pr1 and pr2. Also my data has to match 2 constraints, not 1 (though I'm guessing that I could j

Re: [SQL] Cursor

2008-08-19 Thread Fernando Hevia
> De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] En nombre de Xavier Bermeo > Enviado el: Sábado, 16 de Agosto de 2008 14:54 > Para: pgsql-sql@postgresql.org > Asunto: [SQL] Cursor > > Hi, guys... > I have problems with cursosrs. > Anyone have an example co

[SQL] LIMIT question

2008-08-19 Thread EXT-Rothermel, Peter M
I need to use a LIMIT count in a query but I also need to know how many rows the query itself would yield without the limit. I can do this inside a transaction like this BEGIN SELECT COUNT(*) from table1 where blah; select * from table1 where blah LIMIT 1000; COMMIT Now I can give some feedback l

Re: [SQL] LIMIT question

2008-08-19 Thread Richard Broersma
On Tue, Aug 19, 2008 at 1:58 PM, EXT-Rothermel, Peter M <[EMAIL PROTECTED]> wrote: > Now I can give some feedback like your search matches 200,000 but was > limited to 1000 items. > Is there a better way to accomplish this goal? Here is a nice discussion on the alternatives open to you: http://www

Re: [SQL] Join question

2008-08-19 Thread Edward W. Rouse
Finally got it to work. I used 2 separate selects and a union. So one of the selects was like my original left outer joined select and then I unioned it with one that got the missed nulls from the other table. Thanks for all the advice. Edward W. Rouse -Original Message- From: [EMAIL

Re: [SQL] LIMIT question

2008-08-19 Thread Tom Lane
"Richard Broersma" <[EMAIL PROTECTED]> writes: > <[EMAIL PROTECTED]> wrote: >> Is there a better way to accomplish this goal? > Here is a nice discussion on the alternatives open to you: > http://www.commandprompt.com/blogs/joshua_drake/2007/08/how_many_rows_do_i_have_anyway/ That doesn't really