Re: [SQL] [GENERAL] Looking for information on PostgreSQL Stored Procedures

2005-12-10 Thread Michael Fuhr
On Sat, Dec 10, 2005 at 09:02:39PM -0600, Foster, Stephen wrote: > I did see last week something on PLPGSQL and read through that. But > there has to be something out there that goes in depth on the > SQL/Function command set(Speaking of functions/procedures). The standard functions are described

[SQL] Looking for information on PostgreSQL Stored Procedures

2005-12-10 Thread Foster, Stephen
This could be an old conversation for most. I've used PostgreSQL for a while but I haven't fully use the Procedure/Functions to it fullest until now. I need to migrate a MS-SQL 2000 database to PostgreSQL. I've read as much as I could find but I seem to be missing something. I did see last week

Re: [SQL] select count of distinct rows

2005-12-10 Thread Havasvölgyi Ottó
Oh, that's it. Thank you all very much. Otto - Original Message - From: "Frank Bax" <[EMAIL PROTECTED]> To: Sent: Sunday, December 11, 2005 2:23 AM Subject: Re: [SQL] select count of distinct rows At 07:53 PM 12/10/05, Havasvölgyi Ottó wrote: I would like to select the count of d

Re: [SQL] select count of distinct rows

2005-12-10 Thread Havasvölgyi Ottó
Yes, almost. I need the list of all different rows. It's syntax error at the *. ROW(*) ^ Otto - Original Message - From: "Jaime Casanova" <[EMAIL PROTECTED]> To: "Havasvölgyi Ottó" <[EMAIL PROTECTED]> Cc: Sent: Sunday, December 11, 2005 2:16 AM Subject: Re: select count of d

Re: [SQL] select count of distinct rows

2005-12-10 Thread Foster, Stephen
Well, I find the problem on my end. I was working with a new database that I forgot to filler yet. Yes, it works. Jaime, I think what he is trying to do is get the record count. I would agree that using that statement is a bit much. But using SELECT COUNT(*) FROM mytable; would give the same t

Re: [SQL] select count of distinct rows

2005-12-10 Thread Frank Bax
At 07:53 PM 12/10/05, Havasvölgyi Ottó wrote: I would like to select the count of distinct rows in a table. SELECT COUNT(DISTINCT *) FROM mytable; This does not work. How can I do it with Postgres? select count(*) from (select distinct * from mytable) as x; --

Re: [SQL] select count of distinct rows

2005-12-10 Thread Havasvölgyi Ottó
Hi, This works for me but the result is not that what is expected. I returns with the number of rows in the table, and the distinct has no effect because there is only one row in the result. Best Regards, Otto - Original Message - From: "Foster, Stephen" <[EMAIL PROTECTED]> To: "'H

Re: [SQL] select count of distinct rows

2005-12-10 Thread Jaime Casanova
On 12/10/05, Havasvölgyi Ottó <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to select the count of distinct rows in a table. > > SELECT COUNT(DISTINCT *) FROM mytable; > > This does not work. How can I do it with Postgres? > > Thanks, > Otto > I guess what you need is to know how many times a

Re: [SQL] select count of distinct rows

2005-12-10 Thread Jaime Casanova
On 12/10/05, Foster, Stephen <[EMAIL PROTECTED]> wrote: > Well this should work but I tried it and it didn't. > > SELECT DISTINCT COUNT(*) FROM mytable; > No, it shouldn't work... actually is a non-sense, count will return just one value so there is nothing to be distinct with... -- regards, Jaim

Re: [SQL] select count of distinct rows

2005-12-10 Thread Foster, Stephen
Well this should work but I tried it and it didn't. SELECT DISTINCT COUNT(*) FROM mytable; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Havasvölgyi Ottó Sent: Saturday, December 10, 2005 7:07 PM To: Jaime Casanova Cc: pgsql-sql@postgresql.org Subject:

Re: [SQL] select count of distinct rows

2005-12-10 Thread Havasvölgyi Ottó
Hi, Yes, I need to compare all fields. Well, in this case it does not. Is this impossible? Thanks, Otto - Original Message - From: "Jaime Casanova" <[EMAIL PROTECTED]> To: "Havasvölgyi Ottó" <[EMAIL PROTECTED]> Cc: Sent: Sunday, December 11, 2005 1:57 AM Subject: Re: [SQL] select c

Re: [SQL] select count of distinct rows

2005-12-10 Thread Jaime Casanova
On 12/10/05, Havasvölgyi Ottó <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to select the count of distinct rows in a table. > > SELECT COUNT(DISTINCT *) FROM mytable; > are really all the fields distincts? the table doesn't have a pk? > This does not work. How can I do it with Postgres? > >

[SQL] select count of distinct rows

2005-12-10 Thread Havasvölgyi Ottó
Hi,   I would like to select the count of distinct rows in a table.   SELECT COUNT(DISTINCT *) FROM mytable;   This does not work. How can I do it with Postgres?   Thanks, Otto

Re: [SQL] Error from trigger

2005-12-10 Thread Leif B. Kristensen
On Thursday 08 December 2005 05:11, Tom Lane wrote: >Just starting a fresh session should make the problem go away, or if >that's not practical update the function definition using ALTER > FUNCTION or CREATE OR REPLACE FUNCTION. (You don't need to actually > *change* anything about the function, j